diff options
author | Duda Dornelles <dudassdornelles@gmail.com> | 2015-01-09 13:11:33 -0200 |
---|---|---|
committer | Pixpoa pairing <pixpoapairing@pixelated-project.org> | 2015-01-09 13:18:34 -0200 |
commit | 68a893237c9cdf67f91909981e024d7bf306b73c (patch) | |
tree | 1ee43c3204e07cf05a5222c3de4680e0068c8ba5 /service/test/unit/adapter | |
parent | 69a0650615935e7fd6a20656c4248b95cbe10317 (diff) |
#164 sometimes a mail with more than one alternative will not have an html part
Diffstat (limited to 'service/test/unit/adapter')
-rw-r--r-- | service/test/unit/adapter/mail_test.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/service/test/unit/adapter/mail_test.py b/service/test/unit/adapter/mail_test.py index a845d665..9dc54e66 100644 --- a/service/test/unit/adapter/mail_test.py +++ b/service/test/unit/adapter/mail_test.py @@ -151,6 +151,16 @@ class TestPixelatedMail(unittest.TestCase): self.assertRegexpMatches(mail.html_body, '^<p>blablabla</p>$') self.assertRegexpMatches(mail.text_plain_body, '^blablabla$') + def test_html_is_none_if_multiple_alternatives_have_no_html_part(self): + parts = { + 'attachments': [], + 'alternatives': [ + {'content': u'content', 'headers': {u'Content-Type': u'text/plain; charset=us-ascii'}}, + {'content': u'', 'headers': {u'Some info': u'info'}}]} + + mail = PixelatedMail.from_soledad(None, None, None, parts=parts, soledad_querier=None) + self.assertIsNone(mail.html_body) + def test_percent_character_is_allowed_on_body(self): parts = {'alternatives': [], 'attachments': []} parts['alternatives'].append({'content': '100% happy with percentage symbol', 'headers': {'Content-Type': 'text/plain'}}) |