From f5465700a85f34893de6e12302656543f1370254 Mon Sep 17 00:00:00 2001 From: crccheck Date: Thu, 26 Sep 2013 15:07:27 -0500 Subject: [PATCH] Add: failing test for html only messages --- djrill/tests/test_mandrill_send.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/djrill/tests/test_mandrill_send.py b/djrill/tests/test_mandrill_send.py index b367830..d0c52e0 100644 --- a/djrill/tests/test_mandrill_send.py +++ b/djrill/tests/test_mandrill_send.py @@ -118,6 +118,17 @@ class DjrillBackendTests(DjrillBackendMockAPITestCase): # Don't accidentally send the html part as an attachment: self.assertFalse('attachments' in data['message']) + def test_html_only_message(self): + html_content = '

This is an important message.

' + email = mail.EmailMessage('Subject', html_content, + 'from@example.com', ['to@example.com']) + email.content_subtype = "html" # Main content is now text/html + email.send() + self.assert_mandrill_called("/messages/send.json") + data = self.get_api_call_data() + self.assertNotIn('text', data['message']) + self.assertEqual(data['message']['html'], html_content) + def test_attachments(self): email = mail.EmailMessage('Subject', 'Body goes here', 'from@example.com', ['to1@example.com'])