From cd831d1dfc42c2a0d292fe5c1b7f497b2ca393eb Mon Sep 17 00:00:00 2001 From: Giovane Date: Thu, 14 Jan 2016 18:34:00 -0200 Subject: Removes InputMail.FROM_EMAIL_ADDRESS constant #578 - Created the replier component to generate the reply dict for the email. This was needed to decouple the InputMail from the need to know who is the logged user. --- service/test/unit/adapter/test_mail_service.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'service/test/unit/adapter/test_mail_service.py') diff --git a/service/test/unit/adapter/test_mail_service.py b/service/test/unit/adapter/test_mail_service.py index 27c80fde..a8b6d597 100644 --- a/service/test/unit/adapter/test_mail_service.py +++ b/service/test/unit/adapter/test_mail_service.py @@ -45,7 +45,7 @@ class TestMailService(unittest.TestCase): def test_send_mail(self): input_mail = InputMail() - when(InputMail).from_dict(ANY()).thenReturn(input_mail) + when(InputMail).from_dict(ANY(), ANY()).thenReturn(input_mail) when(self.mail_sender).sendmail(ANY()).thenReturn(defer.Deferred()) sent_deferred = self.mail_service.send_mail(mail_dict()) @@ -60,7 +60,7 @@ class TestMailService(unittest.TestCase): def test_send_mail_removes_draft(self): mail = LeapMail('id', 'INBOX') when(mail).raw = 'raw mail' - when(InputMail).from_dict(ANY()).thenReturn(mail) + when(InputMail).from_dict(ANY(), ANY()).thenReturn(mail) when(self.mail_store).delete_mail('12').thenReturn(defer.succeed(None)) when(self.mail_store).add_mail('SENT', ANY()).thenReturn(mail) @@ -77,7 +77,7 @@ class TestMailService(unittest.TestCase): def test_send_mail_marks_as_read(self): mail = InputMail() when(mail).raw = 'raw mail' - when(InputMail).from_dict(ANY()).thenReturn(mail) + when(InputMail).from_dict(ANY(), ANY()).thenReturn(mail) when(self.mail_store).delete_mail('12').thenReturn(defer.succeed(None)) when(self.mail_sender).sendmail(mail).thenReturn(defer.succeed(None)) @@ -93,7 +93,7 @@ class TestMailService(unittest.TestCase): @defer.inlineCallbacks def test_send_mail_does_not_delete_draft_on_error(self): input_mail = InputMail() - when(InputMail).from_dict(ANY()).thenReturn(input_mail) + when(InputMail).from_dict(ANY(), ANY()).thenReturn(input_mail) deferred_failure = defer.fail(Exception("Assume sending mail failed")) when(self.mail_sender).sendmail(ANY()).thenReturn(deferred_failure) -- cgit v1.2.3