Merge pull request #806 from alphagov/add-logging-for-ses-callback

Small change to include the reference that SES send us on the callback.
This commit is contained in:
Leo Hemsted
2017-01-30 14:24:07 +00:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -85,7 +85,7 @@ def process_ses_response():
)
if not notification:
error = "SES callback failed: notification either not found or already updated " \
"from sending. Status {}".format(notification_status)
"from sending. Status {} for notification reference {}".format(notification_status, reference)
raise InvalidRequest(error, status_code=404)
if not aws_response_dict['success']:

View File

@@ -453,7 +453,7 @@ def test_ses_callback_should_fail_if_notification_cannot_be_found(notify_db, not
json_resp = json.loads(response.get_data(as_text=True))
assert response.status_code == 404
assert json_resp['result'] == 'error'
assert json_resp['message'] == 'SES callback failed: notification either not found or already updated from sending. Status delivered' # noqa
assert json_resp['message'] == 'SES callback failed: notification either not found or already updated from sending. Status delivered for notification reference missing' # noqa
def test_ses_callback_should_update_notification_status(
@@ -592,7 +592,7 @@ def test_ses_callback_should_not_set_status_once_status_is_delivered(client,
json_resp = json.loads(response.get_data(as_text=True))
assert response.status_code == 404
assert json_resp['result'] == 'error'
assert json_resp['message'] == 'SES callback failed: notification either not found or already updated from sending. Status temporary-failure' # noqa
assert json_resp['message'] == 'SES callback failed: notification either not found or already updated from sending. Status temporary-failure for notification reference ref' # noqa
assert get_notification_by_id(notification.id).status == 'delivered'