From f4d7541c9b6dcf67b57b13f7ca7434ec68eeb59c Mon Sep 17 00:00:00 2001 From: Roald de Vries Date: Thu, 6 Oct 2016 17:03:44 -0300 Subject: use test client in test case through composition instead of inheritance --- service/test/integration/test_draft_service.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'service/test/integration/test_draft_service.py') 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) -- cgit v1.2.3