diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-09-09 18:15:39 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-09-09 18:15:39 +0200 |
commit | 83ca259ee6e14281dd7087a2187d7a592f6b9e77 (patch) | |
tree | 45a41a231b485787216242f17ecbb1b5d1a2c31f /service/test/unit/adapter/mailstore | |
parent | 7f5c0ec1424ac629c4ab60d72ff9b1a3717fb4c8 (diff) |
Fix mixed encodings in mail subjects
- Issue #450
Diffstat (limited to 'service/test/unit/adapter/mailstore')
-rw-r--r-- | service/test/unit/adapter/mailstore/test_leap_mail.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/service/test/unit/adapter/mailstore/test_leap_mail.py b/service/test/unit/adapter/mailstore/test_leap_mail.py index 571e2f60..925bfdce 100644 --- a/service/test/unit/adapter/mailstore/test_leap_mail.py +++ b/service/test/unit/adapter/mailstore/test_leap_mail.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (c) 2015 ThoughtWorks, Inc. # @@ -114,6 +115,13 @@ class TestLeapMail(TestCase): self.assertEqual([expected_address], mail.as_dict()['replying']['all']['cc-field']) self.assertEqual(expected_address, mail.as_dict()['replying']['single']) + def test_as_dict_with_mixed_encodings(self): + subject = 'Another test with =?iso-8859-1?B?3G1s5Px0?= =?iso-8859-1?Q?s?=' + mail = LeapMail('', 'INBOX', + {'Subject': subject}) + + self.assertEqual(u'Another test with Ümläüts', mail.as_dict()['header']['subject']) + def test_raw_constructed_by_headers_and_body(self): body = 'some body content' mail = LeapMail('doc id', 'INBOX', {'From': 'test@example.test', 'Subject': 'A test Mail', 'To': 'receiver@example.test'}, ('foo', 'bar'), body=body) |