From 90aff82d713e4c288612ad8c339e7613be706781 Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Fri, 19 Sep 2014 10:23:07 -0300 Subject: Update draft route --- service/test/user_agent_test.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'service/test/user_agent_test.py') diff --git a/service/test/user_agent_test.py b/service/test/user_agent_test.py index 8661a59a..32557f39 100644 --- a/service/test/user_agent_test.py +++ b/service/test/user_agent_test.py @@ -32,7 +32,7 @@ class UserAgentTest(unittest.TestCase): def test_create_or_send_draft_should_create_draft_if_mail_has_no_ident(self): mail = self.mail_without_ident() - pixelated.adapter.pixelated_mail.from_dict = lambda self: mail # has no ident + pixelated.adapter.pixelated_mail.from_dict = lambda x: mail # has no ident self.app.post('/mails', data='{}', content_type="application/json") @@ -40,12 +40,20 @@ class UserAgentTest(unittest.TestCase): def test_create_or_send_draft_should_send_draft_if_mail_has_ident(self): mail = self.mail_with_ident() - pixelated.adapter.pixelated_mail.from_dict = lambda self: mail # does have ident + pixelated.adapter.pixelated_mail.from_dict = lambda x: mail # does have ident self.app.post('/mails', data='{}', content_type="application/json") verify(self.mail_service).send_draft(mail) + def test_update_draft(self): + mail = PixelatedMail() + pixelated.adapter.pixelated_mail.from_dict = lambda x: mail + + self.app.put('/mails', data='{}', content_type="application/json") + + verify(self.mail_service).update_draft(mail) + def mail_without_ident(self): mail = PixelatedMail() mail.ident = '' -- cgit v1.2.3