mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Use specific ESP name in error messages.
Change (e.g.,) "ESP API response 400" to "Mailgun API response 400".
This commit is contained in:
@@ -294,9 +294,8 @@ class SendGridBackendStandardEmailTests(SendGridBackendMockAPITestCase):
|
||||
|
||||
def test_api_failure(self):
|
||||
self.set_mock_response(status_code=400)
|
||||
with self.assertRaises(AnymailAPIError):
|
||||
sent = mail.send_mail('Subject', 'Body', 'from@example.com', ['to@example.com'])
|
||||
self.assertEqual(sent, 0)
|
||||
with self.assertRaisesMessage(AnymailAPIError, "SendGrid API response 400"):
|
||||
mail.send_mail('Subject', 'Body', 'from@example.com', ['to@example.com'])
|
||||
|
||||
# Make sure fail_silently is respected
|
||||
self.set_mock_response(status_code=400)
|
||||
|
||||
Reference in New Issue
Block a user