mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41: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):
|
||||
"""AnymailAPIError should include ESP's error message"""
|
||||
failure_response = b"""{ "errors": [ {
|
||||
"message": "Something went wrong",
|
||||
"description": "Helpful explanation from your ESP"
|
||||
} ] }"""
|
||||
failure_response = b"""{
|
||||
"errors": [{
|
||||
"message": "Helpful explanation from your ESP"
|
||||
}]
|
||||
}"""
|
||||
self.set_mock_failure(raw=failure_response)
|
||||
with self.assertRaisesMessage(AnymailAPIError, "Helpful explanation from your ESP"):
|
||||
self.message.send()
|
||||
|
||||
Reference in New Issue
Block a user