Merge pull request #248 from alphagov/mmg-client-fix

Update MMG responses so that 3 is success.
This commit is contained in:
Rebecca Law
2016-04-20 14:45:08 +01:00
3 changed files with 4 additions and 10 deletions

View File

@@ -6,13 +6,7 @@ from app.clients import (STATISTICS_DELIVERED, STATISTICS_FAILURE)
from app.clients.sms import (SmsClient, SmsClientException) from app.clients.sms import (SmsClient, SmsClientException)
mmg_response_map = { mmg_response_map = {
'00': { '3': {
"message": 'Delivered',
"notification_statistics_status": STATISTICS_DELIVERED,
"success": True,
"notification_status": 'delivered'
},
'0': {
"message": 'Delivered', "message": 'Delivered',
"notification_statistics_status": STATISTICS_DELIVERED, "notification_statistics_status": STATISTICS_DELIVERED,
"success": True, "success": True,

View File

@@ -2,7 +2,7 @@ from app.clients.sms.mmg import get_mmg_responses
def test_should_return_correct_details_for_delivery(): def test_should_return_correct_details_for_delivery():
response_dict = get_mmg_responses('0') response_dict = get_mmg_responses('3')
assert response_dict['message'] == 'Delivered' assert response_dict['message'] == 'Delivered'
assert response_dict['notification_status'] == 'delivered' assert response_dict['notification_status'] == 'delivered'
assert response_dict['notification_statistics_status'] == 'delivered' assert response_dict['notification_statistics_status'] == 'delivered'

View File

@@ -1385,7 +1385,7 @@ def test_firetext_callback_should_update_multiple_notification_status_sent(notif
def test_process_mmg_response_return_200_when_cid_is_send_sms_code(notify_api): def test_process_mmg_response_return_200_when_cid_is_send_sms_code(notify_api):
with notify_api.test_request_context(): with notify_api.test_request_context():
data = '{"reference": "10100164", "CID": "send-sms-code", "MSISDN": "447775349060", "status": "00", \ data = '{"reference": "10100164", "CID": "send-sms-code", "MSISDN": "447775349060", "status": "3", \
"deliverytime": "2016-04-05 16:01:07"}' "deliverytime": "2016-04-05 16:01:07"}'
with notify_api.test_client() as client: with notify_api.test_client() as client:
@@ -1403,7 +1403,7 @@ def test_process_mmg_response_returns_200_when_cid_is_valid_notification_id(noti
data = json.dumps({"reference": "mmg_reference", data = json.dumps({"reference": "mmg_reference",
"CID": str(sample_notification.id), "CID": str(sample_notification.id),
"MSISDN": "447777349060", "MSISDN": "447777349060",
"status": "00", "status": "3",
"deliverytime": "2016-04-05 16:01:07"}) "deliverytime": "2016-04-05 16:01:07"})
response = client.post(path='notifications/sms/mmg', response = client.post(path='notifications/sms/mmg',