mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
if missing 'from_email', then 'log_message' will fail to build
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from django.core import mail
|
||||
|
||||
from djrill import MandrillAPIError
|
||||
from djrill.tests.mock_backend import DjrillBackendMockAPITestCase
|
||||
|
||||
|
||||
@@ -39,6 +40,16 @@ class DjrillMandrillSendTemplateTests(DjrillBackendMockAPITestCase):
|
||||
self.assertFalse('from_email' in data['message'])
|
||||
self.assertFalse('from_name' in data['message'])
|
||||
|
||||
def test_send_template_without_from_field_api_failure(self):
|
||||
self.mock_post.return_value = self.MockResponse(status_code=400)
|
||||
msg = mail.EmailMessage('Subject', 'Text Body',
|
||||
'from@example.com', ['to@example.com'])
|
||||
msg.template_name = "PERSONALIZED_SPECIALS"
|
||||
msg.use_template_from = True
|
||||
with self.assertRaises(MandrillAPIError):
|
||||
msg.send()
|
||||
self.assertEqual(sent, 0)
|
||||
|
||||
def test_send_template_without_subject_field(self):
|
||||
msg = mail.EmailMessage('Subject', 'Text Body',
|
||||
'from@example.com', ['to@example.com'])
|
||||
|
||||
Reference in New Issue
Block a user