Check if Django is in the test mode
from django.core import mail @property is_django_in_test_mode(): return hasattr(mail, 'outbox')