diff options
Diffstat (limited to 'service/test/integration/drafts_test.py')
-rw-r--r-- | service/test/integration/drafts_test.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/service/test/integration/drafts_test.py b/service/test/integration/drafts_test.py index e0b49c13..5d2118df 100644 --- a/service/test/integration/drafts_test.py +++ b/service/test/integration/drafts_test.py @@ -27,17 +27,22 @@ class DraftsTest(unittest.TestCase, SoledadTestBase): self.teardown_soledad() def test_post_sends_mail_and_deletes_previous_draft_if_it_exists(self): + # creates one draft first_draft = MailBuilder().with_subject('First draft').build_json() first_draft_ident = self.put_mail(first_draft) + # sends an updated version of the draft second_draft = MailBuilder().with_subject('Second draft').with_ident(first_draft_ident).build_json() self.post_mail(second_draft) sent_mails = self.get_mails_by_tag('sent') drafts = self.get_mails_by_tag('drafts') + # make sure there is one email in the sent mailbox and it is the second draft self.assertEquals(1, len(sent_mails)) self.assertEquals('Second draft', sent_mails[0].subject) + + # make sure that there are no drafts in the draft mailbox self.assertEquals(0, len(drafts)) def test_post_sends_mail_even_when_draft_does_not_exist(self): |