summaryrefslogtreecommitdiff
path: root/service/test/unit/adapter
diff options
context:
space:
mode:
authorJefferson Stachelski <jstachel@thoughtworks.com>2015-11-26 15:49:54 -0200
committerJefferson Stachelski <jstachel@thoughtworks.com>2015-11-26 15:49:54 -0200
commite889a46fdf1b38fcbc9a8338fd2948e564d993cf (patch)
treef82dca3b5ba13f7d56cbc931453d5a5de349be6b /service/test/unit/adapter
parent243464b44bbc4d78f4c5aa79b4c70b7444456677 (diff)
Issue #532 - Removing name from canonical address
Now the canonical mail address are been parsed to a common one, but it is a Twisted smtp bug that should be fixed in the future
Diffstat (limited to 'service/test/unit/adapter')
-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 562f919d..cd4a84c3 100644
--- a/service/test/unit/adapter/services/test_mail_sender.py
+++ b/service/test/unit/adapter/services/test_mail_sender.py
@@ -100,3 +100,17 @@ class MailSenderTest(unittest.TestCase):
for recipient in flatten([input_mail.to, input_mail.cc, input_mail.bcc]):
verify(OutgoingMail).send_message(MailToSmtpFormatCapture(recipient, bccs), TwistedSmtpUserCapture(recipient))
+
+ def test_remove_canonical_recipient_when_it_is_not_canonical(self):
+ recipient = u'user@pixelated.org'
+
+ non_canonical = self.sender._remove_canonical_recipient(recipient)
+
+ self.assertEqual(recipient, non_canonical)
+
+ def test_remove_canonical_recipient_when_it_is_canonical(self):
+ recipient = u'User <user@pixelated.org>'
+
+ non_canonical = self.sender._remove_canonical_recipient(recipient)
+
+ self.assertEqual(u'user@pixelated.org', non_canonical)