mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
Lowercase the client name when sent_by is empty
This commit is contained in:
@@ -85,7 +85,7 @@ def _process_for_status(notification_status, client_name, provider_reference):
|
|||||||
statsd_client.incr('callback.{}.{}'.format(client_name.lower(), notification_status))
|
statsd_client.incr('callback.{}.{}'.format(client_name.lower(), notification_status))
|
||||||
|
|
||||||
if not notification.sent_by:
|
if not notification.sent_by:
|
||||||
set_notification_sent_by(notification, client_name)
|
set_notification_sent_by(notification, client_name.lower())
|
||||||
|
|
||||||
if notification.sent_at:
|
if notification.sent_at:
|
||||||
statsd_client.timing_with_dates(
|
statsd_client.timing_with_dates(
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ def test_process_sms_updates_sent_by_with_client_name_if_not_in_noti(notify_db,
|
|||||||
status='3', provider_reference=str(sample_notification.id), client_name='MMG')
|
status='3', provider_reference=str(sample_notification.id), client_name='MMG')
|
||||||
assert error is None
|
assert error is None
|
||||||
assert success == 'MMG callback succeeded. reference {} updated'.format(sample_notification.id)
|
assert success == 'MMG callback succeeded. reference {} updated'.format(sample_notification.id)
|
||||||
assert sample_notification.sent_by == 'MMG'
|
assert sample_notification.sent_by == 'mmg'
|
||||||
|
|
||||||
|
|
||||||
def test_process_sms_does_not_update_sent_by_if_already_set(mocker, notify_db, sample_notification):
|
def test_process_sms_does_not_update_sent_by_if_already_set(mocker, notify_db, sample_notification):
|
||||||
|
|||||||
Reference in New Issue
Block a user