Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django send_mail not working in testcase

# The Django test runner will actually configure a different email backend for you.
# To override it do the following

from django.test.utils import override_settings

@override_settings(
    EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend')
def test_send_email_with_real_SMTP(self):
   # your code goes here....
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #working #testcase
ADD COMMENT
Topic
Name
3+7 =