From 3d41fa963450825094277e3dc001159af4f390e9 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Thu, 1 Sep 2016 10:23:37 +0100 Subject: [PATCH] Update mmg status code 2 to be a permanent failure. --- app/clients/sms/mmg.py | 4 ++-- tests/app/notifications/rest/test_callbacks.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/clients/sms/mmg.py b/app/clients/sms/mmg.py index 0615c7a1c..066c1f259 100644 --- a/app/clients/sms/mmg.py +++ b/app/clients/sms/mmg.py @@ -6,10 +6,10 @@ from app.clients.sms import (SmsClient, SmsClientException) mmg_response_map = { '2': { - "message": ' Temporary failure', + "message": ' Permanent failure', "notification_statistics_status": STATISTICS_FAILURE, "success": False, - "notification_status": 'temporary-failure' + "notification_status": 'permanent-failure' }, '3': { "message": 'Delivered', diff --git a/tests/app/notifications/rest/test_callbacks.py b/tests/app/notifications/rest/test_callbacks.py index cc4fa4fbd..7364145d2 100644 --- a/tests/app/notifications/rest/test_callbacks.py +++ b/tests/app/notifications/rest/test_callbacks.py @@ -297,8 +297,8 @@ def test_process_mmg_response_status_5_updates_notification_with_permanently_fai assert get_notification_by_id(sample_notification.id).status == 'permanent-failure' -def test_process_mmg_response_status_2_updates_notification_with_temporary_failed(notify_api, - sample_notification): +def test_process_mmg_response_status_2_updates_notification_with_permanently_failed(notify_api, + sample_notification): with notify_api.test_client() as client: data = json.dumps({"reference": "mmg_reference", "CID": str(sample_notification.id), @@ -312,7 +312,7 @@ def test_process_mmg_response_status_2_updates_notification_with_temporary_faile json_data = json.loads(response.data) assert json_data['result'] == 'success' assert json_data['message'] == 'MMG callback succeeded. reference {} updated'.format(sample_notification.id) - assert get_notification_by_id(sample_notification.id).status == 'temporary-failure' + assert get_notification_by_id(sample_notification.id).status == 'permanent-failure' def test_process_mmg_response_status_4_updates_notification_with_temporary_failed(notify_api,