diff options
author | Patrick Maia and Victor Shyba <pixelated-team+pmaia+vshyba@thoughtworks.com> | 2014-10-27 14:40:55 -0300 |
---|---|---|
committer | Patrick Maia and Victor Shyba <pixelated-team+pmaia+vshyba@thoughtworks.com> | 2014-10-27 14:41:10 -0300 |
commit | 3f7c5fd9a9506957b722a47f2fbdb7e587654823 (patch) | |
tree | eb1c791d834840018f63198deabc491224cd2c0f /service/test/unit | |
parent | 30ab7258392ebb884ca835ec32000275c61c65d0 (diff) |
Card #30 - fixes bug in which % character on multipart body was causing an exception
Diffstat (limited to 'service/test/unit')
-rw-r--r-- | service/test/unit/adapter/mail_test.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/service/test/unit/adapter/mail_test.py b/service/test/unit/adapter/mail_test.py index 35fe411e..8b35b181 100644 --- a/service/test/unit/adapter/mail_test.py +++ b/service/test/unit/adapter/mail_test.py @@ -102,6 +102,15 @@ class TestPixelatedMail(unittest.TestCase): self.assertRegexpMatches(mail.body, '\nContent-Type: text/plain\n\nblablabla\n') self.assertRegexpMatches(mail.body, '.*--' + mail.boundary + '--$') + 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'}}) + parts['alternatives'].append({'content': '<p>100% happy with percentage symbol</p>', 'headers': {'Content-Type': 'text/html'}}) + + mail = PixelatedMail.from_soledad(None, None, None, None, parts=parts) + + self.assertRegexpMatches(mail.body, '([\s\S]*100%){2}') + class InputMailTest(unittest.TestCase): mail_dict = lambda x: { |