mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
Defend against status code 00 or 0 from mmg
This commit is contained in:
@@ -6,6 +6,12 @@ from app.clients import (STATISTICS_DELIVERED, STATISTICS_FAILURE)
|
||||
from app.clients.sms import (SmsClient, SmsClientException)
|
||||
|
||||
mmg_response_map = {
|
||||
'00': {
|
||||
"message": 'Delivered',
|
||||
"notification_statistics_status": STATISTICS_DELIVERED,
|
||||
"success": True,
|
||||
"notification_status": 'delivered'
|
||||
},
|
||||
'0': {
|
||||
"message": 'Delivered',
|
||||
"notification_statistics_status": STATISTICS_DELIVERED,
|
||||
|
||||
@@ -1360,11 +1360,8 @@ 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):
|
||||
with notify_api.test_request_context():
|
||||
data = json.dumps({"reference": "10100164",
|
||||
"CID": "send-sms-code",
|
||||
"MSISDN": "447775349060",
|
||||
"status": 00,
|
||||
"deliverytime": "2016-04-05 16:01:07"})
|
||||
data = '{"reference": "10100164", "CID": "send-sms-code", "MSISDN": "447775349060", "status": "00", \
|
||||
"deliverytime": "2016-04-05 16:01:07"}'
|
||||
|
||||
with notify_api.test_client() as client:
|
||||
response = client.post(path='notifications/sms/mmg',
|
||||
@@ -1381,7 +1378,7 @@ def test_process_mmg_response_returns_200_when_cid_is_valid_notification_id(noti
|
||||
data = json.dumps({"reference": "mmg_reference",
|
||||
"CID": str(sample_notification.id),
|
||||
"MSISDN": "447777349060",
|
||||
"status": 00,
|
||||
"status": "00",
|
||||
"deliverytime": "2016-04-05 16:01:07"})
|
||||
|
||||
response = client.post(path='notifications/sms/mmg',
|
||||
|
||||
Reference in New Issue
Block a user