diff options
author | Roald de Vries <rdevries@thoughtworks.com> | 2016-10-06 17:03:44 -0300 |
---|---|---|
committer | Roald de Vries <rdevries@thoughtworks.com> | 2016-10-07 18:25:02 -0300 |
commit | f4d7541c9b6dcf67b57b13f7ca7434ec68eeb59c (patch) | |
tree | 8d50a54a9a8d5dd451253e55275f209f9df32b0a /service/test/integration/test_contacts.py | |
parent | 4642cee939c08bfa809f55b6a85ffa773600eaf9 (diff) |
use test client in test case through composition instead of inheritance
Diffstat (limited to 'service/test/integration/test_contacts.py')
-rw-r--r-- | service/test/integration/test_contacts.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/service/test/integration/test_contacts.py b/service/test/integration/test_contacts.py index e7fabdb7..946818fd 100644 --- a/service/test/integration/test_contacts.py +++ b/service/test/integration/test_contacts.py @@ -24,9 +24,9 @@ class ContactsTest(SoledadTestBase): @defer.inlineCallbacks def test_TO_CC_and_BCC_fields_are_being_searched(self): input_mail = MailBuilder().with_tags(['important']).build_input_mail() - yield self.add_mail_to_inbox(input_mail) + yield self.app_test_client.add_mail_to_inbox(input_mail) - contacts = yield self.get_contacts(query='recipient') + contacts = yield self.app_test_client.get_contacts(query='recipient') self.assertTrue('recipient@to.com' in contacts) self.assertTrue('recipient@cc.com' in contacts) @@ -35,20 +35,20 @@ class ContactsTest(SoledadTestBase): @defer.inlineCallbacks def test_FROM_address_is_being_searched(self): input_mail = MailBuilder().with_tags(['important']).with_from('Formatted Sender <sender@from.com>').build_input_mail() - yield self.add_mail_to_inbox(input_mail) + yield self.app_test_client.add_mail_to_inbox(input_mail) - contacts = yield self.get_contacts(query='Sender') + contacts = yield self.app_test_client.get_contacts(query='Sender') self.assertIn('Formatted Sender <sender@from.com>', contacts) @defer.inlineCallbacks def test_trash_and_drafts_mailboxes_are_being_ignored(self): - yield self.add_multiple_to_mailbox(1, mailbox='INBOX', to='recipient@inbox.com') - yield self.add_multiple_to_mailbox(1, mailbox='DRAFTS', to='recipient@drafts.com') - yield self.add_multiple_to_mailbox(1, mailbox='SENT', to='recipient@sent.com') - yield self.add_multiple_to_mailbox(1, mailbox='TRASH', to='recipient@trash.com') + yield self.app_test_client.add_multiple_to_mailbox(1, mailbox='INBOX', to='recipient@inbox.com') + yield self.app_test_client.add_multiple_to_mailbox(1, mailbox='DRAFTS', to='recipient@drafts.com') + yield self.app_test_client.add_multiple_to_mailbox(1, mailbox='SENT', to='recipient@sent.com') + yield self.app_test_client.add_multiple_to_mailbox(1, mailbox='TRASH', to='recipient@trash.com') - contacts = yield self.get_contacts(query='recipient') + contacts = yield self.app_test_client.get_contacts(query='recipient') self.assertTrue('recipient@inbox.com' in contacts) self.assertTrue('recipient@sent.com' in contacts) @@ -65,10 +65,10 @@ class ContactsTest(SoledadTestBase): formatted_input_mail.with_bcc('Recipient Carbon <recipient@bcc.com>') formatted_input_mail = formatted_input_mail.build_input_mail() - yield self.add_mail_to_inbox(input_mail) - yield self.add_mail_to_inbox(formatted_input_mail) + yield self.app_test_client.add_mail_to_inbox(input_mail) + yield self.app_test_client.add_mail_to_inbox(formatted_input_mail) - contacts = yield self.get_contacts(query='Recipient') + contacts = yield self.app_test_client.get_contacts(query='Recipient') self.assertEquals(4, len(contacts)) self.assertTrue('Recipient Copied <recipient@cc.com>' in contacts) |