summaryrefslogtreecommitdiff
path: root/service/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'service/test/unit')
-rw-r--r--service/test/unit/adapter/services/test_mail_sender.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/service/test/unit/adapter/services/test_mail_sender.py b/service/test/unit/adapter/services/test_mail_sender.py
index 0f02f759..863ac81a 100644
--- a/service/test/unit/adapter/services/test_mail_sender.py
+++ b/service/test/unit/adapter/services/test_mail_sender.py
@@ -77,6 +77,20 @@ class MailSenderTest(unittest.TestCase):
verify(OutgoingMail).send_message(any(), TwistedSmtpUserCapture(recipient))
@defer.inlineCallbacks
+ def test_send_leaves_mail_in_tact(self):
+ input_mail_dict = mail_dict()
+ input_mail = InputMail.from_dict(input_mail_dict, from_address='pixelated@org')
+
+ when(OutgoingMail).send_message(any(), any()).thenReturn(defer.succeed(None))
+
+ yield self.sender.sendmail(input_mail)
+
+ self.assertEqual(input_mail.to, input_mail_dict["header"]["to"])
+ self.assertEqual(input_mail.cc, input_mail_dict["header"]["cc"])
+ self.assertEqual(input_mail.bcc, input_mail_dict["header"]["bcc"])
+ self.assertEqual(input_mail.subject, input_mail_dict["header"]["subject"])
+
+ @defer.inlineCallbacks
def test_problem_with_email_raises_exception(self):
input_mail = InputMail.from_dict(mail_dict(), from_address='pixelated@org')