summaryrefslogtreecommitdiff
path: root/service/test/integration/test_draft_service.py
diff options
context:
space:
mode:
authorRoald de Vries <rdevries@thoughtworks.com>2016-10-06 17:03:44 -0300
committerRoald de Vries <rdevries@thoughtworks.com>2016-10-07 18:25:02 -0300
commitf4d7541c9b6dcf67b57b13f7ca7434ec68eeb59c (patch)
tree8d50a54a9a8d5dd451253e55275f209f9df32b0a /service/test/integration/test_draft_service.py
parent4642cee939c08bfa809f55b6a85ffa773600eaf9 (diff)
use test client in test case through composition instead of inheritance
Diffstat (limited to 'service/test/integration/test_draft_service.py')
-rw-r--r--service/test/integration/test_draft_service.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/service/test/integration/test_draft_service.py b/service/test/integration/test_draft_service.py
index 4f4a9181..159de605 100644
--- a/service/test/integration/test_draft_service.py
+++ b/service/test/integration/test_draft_service.py
@@ -25,23 +25,23 @@ class DraftServiceTest(SoledadTestBase):
def test_store_and_load_draft(self):
input_mail = MailBuilder().with_body('some test text').build_input_mail()
draft_id = None
- stored_draft = yield self.draft_service.process_draft(draft_id, input_mail)
+ stored_draft = yield self.app_test_client.draft_service.process_draft(draft_id, input_mail)
- draft = yield self.mail_store.get_mail(stored_draft.ident, include_body=True)
+ draft = yield self.app_test_client.mail_store.get_mail(stored_draft.ident, include_body=True)
self.assertEqual('some test text', draft.body)
@defer.inlineCallbacks
def test_update_draft(self):
input_mail = MailBuilder().with_body('some test text').build_input_mail()
- saved_mail = yield self.mail_store.add_mail('DRAFTS', input_mail.raw)
+ saved_mail = yield self.app_test_client.mail_store.add_mail('DRAFTS', input_mail.raw)
draft_id = saved_mail.ident
new_email = MailBuilder().with_body('other test text').with_ident(draft_id).build_input_mail()
- stored_draft = yield self.draft_service.process_draft(draft_id, new_email)
+ stored_draft = yield self.app_test_client.draft_service.process_draft(draft_id, new_email)
- old_draft = yield self.mail_store.get_mail(draft_id, include_body=True)
- draft = yield self.mail_store.get_mail(stored_draft.ident, include_body=True)
+ old_draft = yield self.app_test_client.mail_store.get_mail(draft_id, include_body=True)
+ draft = yield self.app_test_client.mail_store.get_mail(stored_draft.ident, include_body=True)
self.assertIsNone(old_draft)
self.assertEqual('other test text', draft.body)