diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-09-19 10:23:07 -0300 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-09-19 10:23:07 -0300 |
commit | 90aff82d713e4c288612ad8c339e7613be706781 (patch) | |
tree | fd8b64238edc5c09113f31d1b05ba7df0040506c /service/test/user_agent_test.py | |
parent | e3871a45b584e8dcb633ba314e1ab1b8593c636b (diff) |
Update draft route
Diffstat (limited to 'service/test/user_agent_test.py')
-rw-r--r-- | service/test/user_agent_test.py | 12 |
1 files changed, 10 insertions, 2 deletions
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 = '' |