fix firetext research mode requests

requests converts dicts into query parameters anyway if you don't specify so dont try and encode the data ourselves, also hardened up tests
This commit is contained in:
Leo Hemsted
2016-06-09 14:14:27 +01:00
parent 3e72440f38
commit fd2a0a0b10
2 changed files with 23 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ def send_sms_response(provider, reference, to):
body = mmg_callback(reference, to)
headers = {"Content-type": "application/json"}
else:
headers = {"Content-type": "text/plain"}
headers = {"Content-type": "application/x-www-form-urlencoded"}
body = firetext_callback(reference, to)
make_request('sms', provider, body, headers)
@@ -92,7 +92,12 @@ def firetext_callback(notification_id, to):
status = "1"
else:
status = "0"
return 'mobile={}&status={}&time=2016-03-10 14:17:00&reference={}'.format(to, status, notification_id)
return {
'mobile': to,
'status': status,
'time': '2016-03-10 14:17:00',
'reference': notification_id
}
def ses_notification_callback(reference):