Created an endpoint to test how the incoming messages from MMG will work.

So this just prints the response to logs, removing the phone number first. Then returns the requested RECEIVED.
This commit is contained in:
Rebecca Law
2017-03-06 11:58:49 +00:00
parent b89923c525
commit 77f520acba
3 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
from flask import json
def test_receive_notification_returns_received_to_mmg(client):
data = {"ID": "1234",
"MSISDN": "447700900855",
"Message": "Some message to notify",
"Trigger": "Trigger?",
"Number": "40604",
"Channel": "SMS",
"DateReceived": "2012-06-27-12:33:00"
}
response = client.post(path='/notifications/sms/receive/mmg',
data=json.dumps(data),
headers=[('Content-Type', 'application/json')])
assert response.status_code == 200
assert response.get_data(as_text=True) == 'RECEIVED'