Created
October 7, 2008 23:27
-
-
Save dirceu/15413 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test import TestCase | |
from django.core import mail | |
from myproject.myapp.views import send_some_emails | |
class FooTestCase(TestCase): | |
def test_email_subject(self): | |
send_some_emails() | |
self.assertEquals(mail.outbox[0].subject, 'My subject') | |
def test_send_some_other_emails(self): | |
# it's empty in the beginning of every test | |
self.assertTrue(len(mail.outbox) == 0) | |
send_some_emails() | |
self.assertTrue(len(mail.outbox) > 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment