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:
medmunds
2018-10-11 16:47:10 -07:00
parent d7ea9971f0
commit eca1f5c399

View File

@@ -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()