diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-03-10 16:45:05 +0100 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-03-10 16:45:05 +0100 |
commit | 7a7ab08316b4aa4f7b18b50626cb0dc16dde3efb (patch) | |
tree | 61e4ba0573974dd8af2ded0ac6b53f2c14295acc /service/test/unit/adapter | |
parent | 7e0f1c7f86c217f903c24e7f0866ac1f6f6b06e7 (diff) |
added support for 7 and 8bit content transfer encoding.
- Issue #312
Diffstat (limited to 'service/test/unit/adapter')
-rw-r--r-- | service/test/unit/adapter/test_mail.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/service/test/unit/adapter/test_mail.py b/service/test/unit/adapter/test_mail.py index ed7b945a..7bbf4cd4 100644 --- a/service/test/unit/adapter/test_mail.py +++ b/service/test/unit/adapter/test_mail.py @@ -211,6 +211,28 @@ class TestPixelatedMail(unittest.TestCase): self.assertEquals(body, mail.text_plain_body) + def test_that_body_understands_7bit(self): + body = u'testtext' + encoded_body = body + + fdoc, hdoc, bdoc = test_helper.leap_mail() + parts = {'alternatives': []} + parts['alternatives'].append({'content': encoded_body, 'headers': {'Content-Transfer-Encoding': '7bit'}}) + mail = PixelatedMail.from_soledad(fdoc, hdoc, bdoc, soledad_querier=self.querier, parts=parts) + + self.assertEquals(body, mail.text_plain_body) + + def test_that_body_understands_8bit(self): + body = u'testtext' + encoded_body = body + + fdoc, hdoc, bdoc = test_helper.leap_mail() + parts = {'alternatives': []} + parts['alternatives'].append({'content': encoded_body, 'headers': {'Content-Transfer-Encoding': '8bit'}}) + mail = PixelatedMail.from_soledad(fdoc, hdoc, bdoc, soledad_querier=self.querier, parts=parts) + + self.assertEquals(body, mail.text_plain_body) + def test_bounced_mails_are_recognized(self): bounced_mail_hdoc = os.path.join(os.path.dirname(__file__), '..', 'fixtures', 'bounced_mail_hdoc.json') with open(bounced_mail_hdoc) as f: |