mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
SparkPost: update backend tests with 1/2019 error format.
Update SparkPost backend tests to follow 1/2019 changes to Transmissions API error reporting format. (No changes are required in the Anymail backend.) See #123
This commit is contained in:
@@ -315,10 +315,11 @@ class SparkPostBackendStandardEmailTests(SparkPostBackendMockAPITestCase):
|
|||||||
|
|
||||||
def test_api_error_includes_details(self):
|
def test_api_error_includes_details(self):
|
||||||
"""AnymailAPIError should include ESP's error message"""
|
"""AnymailAPIError should include ESP's error message"""
|
||||||
failure_response = b"""{ "errors": [ {
|
failure_response = b"""{
|
||||||
"message": "Something went wrong",
|
"errors": [{
|
||||||
"description": "Helpful explanation from your ESP"
|
"message": "Helpful explanation from your ESP"
|
||||||
} ] }"""
|
}]
|
||||||
|
}"""
|
||||||
self.set_mock_failure(raw=failure_response)
|
self.set_mock_failure(raw=failure_response)
|
||||||
with self.assertRaisesMessage(AnymailAPIError, "Helpful explanation from your ESP"):
|
with self.assertRaisesMessage(AnymailAPIError, "Helpful explanation from your ESP"):
|
||||||
self.message.send()
|
self.message.send()
|
||||||
|
|||||||
Reference in New Issue
Block a user