From 83ca259ee6e14281dd7087a2187d7a592f6b9e77 Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Wed, 9 Sep 2015 18:15:39 +0200 Subject: Fix mixed encodings in mail subjects - Issue #450 --- service/test/unit/adapter/mailstore/test_leap_mail.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'service/test/unit/adapter/mailstore/test_leap_mail.py') 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) -- cgit v1.2.3