mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
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:
@@ -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']:
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user