diff options
Diffstat (limited to 'service/test/unit')
-rw-r--r-- | service/test/unit/adapter/test_mail.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/service/test/unit/adapter/test_mail.py b/service/test/unit/adapter/test_mail.py index c7910b7f..68b340a7 100644 --- a/service/test/unit/adapter/test_mail.py +++ b/service/test/unit/adapter/test_mail.py @@ -1,3 +1,4 @@ +# -*- coding: UTF-8 -*- # # Copyright (c) 2014 ThoughtWorks, Inc. # @@ -334,6 +335,17 @@ class TestPixelatedMail(unittest.TestCase): mail.as_dict() + def test_parse_UTF8_headers_with_CharsetAscii(self): + leap_mail_from = u'"söme ümläuds" <lisa5@dev.pixelated-project.org>' + leap_mail_to = u'"söme ümläuds" <lisa5@dev.pixelated-project.org>,\n"söme ümläuds" <lisa5@dev.pixelated-project.org>' + + leap_mail = test_helper.leap_mail(extra_headers={'From': leap_mail_from, 'Subject': "some subject", 'To': leap_mail_to}) + + mail = PixelatedMail.from_soledad(*leap_mail, soledad_querier=self.querier) + + mail.headers['From'].encode('ascii') + self.assertEqual(mail.headers['To'], ['"sme mluds" <lisa5@dev.pixelated-project.org>', '"sme mluds" <lisa5@dev.pixelated-project.org>']) + def simple_mail_dict(): return { |