Files
notifications-api/tests/app/notifications/test_receive_notification.py
Rebecca Law 77f520acba 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.
2017-03-06 11:58:49 +00:00

19 lines
649 B
Python

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'