mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -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:
|
||||
notification_status, detailed_status = response_parser(status, detailed_status_code)
|
||||
current_app.logger.info(
|
||||
f'{client_name} callback returned '
|
||||
f'status of {notification_status}: {detailed_status} for reference: {provider_reference}'
|
||||
f'{client_name} callback returned status of {notification_status}'
|
||||
f'({status}): {detailed_status}({detailed_status_code}) for reference: {provider_reference}'
|
||||
)
|
||||
except KeyError:
|
||||
_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)
|
||||
|
||||
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)
|
||||
assert sample_notification.status == expected_notification_status
|
||||
|
||||
|
||||
Reference in New Issue
Block a user