mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Merge pull request #2860 from alphagov/put-status-codes-in-logs
Put status codes in logs
This commit is contained in:
@@ -38,8 +38,8 @@ def process_sms_client_response(self, status, provider_reference, client_name, d
|
|||||||
try:
|
try:
|
||||||
notification_status, detailed_status = response_parser(status, detailed_status_code)
|
notification_status, detailed_status = response_parser(status, detailed_status_code)
|
||||||
current_app.logger.info(
|
current_app.logger.info(
|
||||||
f'{client_name} callback returned '
|
f'{client_name} callback returned status of {notification_status}'
|
||||||
f'status of {notification_status}: {detailed_status} for reference: {provider_reference}'
|
f'({status}): {detailed_status}({detailed_status_code}) for reference: {provider_reference}'
|
||||||
)
|
)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
_process_for_status(
|
_process_for_status(
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ def test_process_sms_client_response_updates_notification_status(
|
|||||||
|
|
||||||
process_sms_client_response(status, str(sample_notification.id), sms_provider, detailed_status_code)
|
process_sms_client_response(status, str(sample_notification.id), sms_provider, detailed_status_code)
|
||||||
|
|
||||||
message = f"{sms_provider} callback returned status of {expected_notification_status}: {reason} for reference: {sample_notification.id}" # noqa
|
message = f"{sms_provider} callback returned status of {expected_notification_status}({status}): {reason}({detailed_status_code}) for reference: {sample_notification.id}" # noqa
|
||||||
mock_logger.assert_any_call(message)
|
mock_logger.assert_any_call(message)
|
||||||
assert sample_notification.status == expected_notification_status
|
assert sample_notification.status == expected_notification_status
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user