summaryrefslogtreecommitdiff
path: root/service/test/unit/adapter/mail_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'service/test/unit/adapter/mail_test.py')
-rw-r--r--service/test/unit/adapter/mail_test.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/service/test/unit/adapter/mail_test.py b/service/test/unit/adapter/mail_test.py
index 3bec6fc7..35fe411e 100644
--- a/service/test/unit/adapter/mail_test.py
+++ b/service/test/unit/adapter/mail_test.py
@@ -90,6 +90,18 @@ class TestPixelatedMail(unittest.TestCase):
'tags': []
})
+ def test_alternatives_body(self):
+ parts = {'alternatives': [], 'attachments': []}
+ parts['alternatives'].append({'content': 'blablabla', 'headers': {'Content-Type': 'text/plain'}})
+ parts['alternatives'].append({'content': '<p>blablabla</p>', 'headers': {'Content-Type': 'text/html'}})
+
+ mail = PixelatedMail.from_soledad(None, None, None, None, parts=parts)
+
+ self.assertRegexpMatches(mail.body, '^--' + mail.boundary + '\n.*')
+ self.assertRegexpMatches(mail.body, '\nContent-Type: text/html\n\n<p>blablabla</p>\n')
+ self.assertRegexpMatches(mail.body, '\nContent-Type: text/plain\n\nblablabla\n')
+ self.assertRegexpMatches(mail.body, '.*--' + mail.boundary + '--$')
+
class InputMailTest(unittest.TestCase):
mail_dict = lambda x: {