diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-04-09 11:46:35 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-04-09 11:49:09 +0200 |
commit | 88b281330c6fca313bbfd3482ea2aeb5efa08c78 (patch) | |
tree | d592e550dae89965e6aa4d0b7c05f04ff687a327 /service/test | |
parent | 2b5ab82d00fb7ebe746f0df6ef66b014fd4e50f6 (diff) |
Default broken Content-Transfer-Encoding to 8bit.
- Issue #347
Diffstat (limited to 'service/test')
-rw-r--r-- | service/test/unit/adapter/test_mail.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/service/test/unit/adapter/test_mail.py b/service/test/unit/adapter/test_mail.py index dbad72b3..1a9280ff 100644 --- a/service/test/unit/adapter/test_mail.py +++ b/service/test/unit/adapter/test_mail.py @@ -241,6 +241,16 @@ class TestPixelatedMail(unittest.TestCase): self.assertEquals(u'H=E4llo', mail.text_plain_body) + def test_broken_encoding_defaults_to_8bit(self): + plain_headers = {'Content-Type': 'text/plain;\ncharset=iso-8859-1', 'Content-Transfer-Encoding': 'I lie to you!'} + html_headers = {'Content-Type': 'text/html;\ncharset=utf-8', 'Content-Transfer-Encoding': 'quoted-printable'} + parts = {'alternatives': [{'content': 'H=E4llo', 'headers': plain_headers}, {'content': '<p>H=C3=A4llo</p>', 'headers': html_headers}]} + + mail = PixelatedMail.from_soledad(None, None, self._create_bdoc(raw='some raw body'), parts=parts, soledad_querier=None) + + self.assertEquals(u'H=E4llo', mail.text_plain_body) + self.assertEquals(u'<p>H\xe4llo</p>', mail.html_body) + def test_clean_line_breaks_on_address_headers(self): many_recipients = 'One <one@mail.com>,\nTwo <two@mail.com>, Normal <normal@mail.com>,\nalone@mail.com' headers = {'Cc': many_recipients, |