Merge branch 'feature/use-mandrill-template-defaults' of git://github.com/nikolay-saskovets/Djrill into nikolay-saskovets-feature/use-mandrill-template-defaults

This commit is contained in:
medmunds
2014-05-28 20:42:36 -07:00
3 changed files with 41 additions and 0 deletions

View File

@@ -27,6 +27,20 @@ class DjrillMandrillSendTemplateTests(DjrillBackendMockAPITestCase):
'content': "<p><em>Half off</em> all fruit</p>"} ]
)
def test_send_template_without_from_field(self):
msg = mail.EmailMessage('Subject', 'Text Body',
'from@example.com', ['to@example.com'])
msg.template_name = "PERSONALIZED_SPECIALS"
msg.clear_from = True
msg.clear_subject = True
msg.send()
self.assert_mandrill_called("/messages/send-template.json")
data = self.get_api_call_data()
self.assertEqual(data['template_name'], "PERSONALIZED_SPECIALS")
self.assertEqual(data['message']['subject'], "")
self.assertEqual(data['message']['from_email'], "")
self.assertEqual(data['message']['from_name'], "")
def test_no_template_content(self):
# Just a template, without any template_content to be merged
msg = mail.EmailMessage('Subject', 'Text Body',