mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
Added simple logging endpoint for fire text inbound SMS calls
- logs post data - OK to log all as not currently in use so no real user data expected.
This commit is contained in:
@@ -19,7 +19,7 @@ def receive_mmg_sms():
|
|||||||
|
|
||||||
@receive_notifications_blueprint.route('/notifications/sms/receive/firetext', methods=['POST'])
|
@receive_notifications_blueprint.route('/notifications/sms/receive/firetext', methods=['POST'])
|
||||||
def receive_firetext_sms():
|
def receive_firetext_sms():
|
||||||
post_data = request.get_json()
|
post_data = request.form
|
||||||
current_app.logger.info("Received Firetext notification form data: {}".format(post_data))
|
current_app.logger.info("Received Firetext notification form data: {}".format(post_data))
|
||||||
|
|
||||||
return jsonify({
|
return jsonify({
|
||||||
|
|||||||
@@ -19,11 +19,12 @@ def test_receive_notification_returns_received_to_mmg(client):
|
|||||||
|
|
||||||
|
|
||||||
def test_receive_notification_returns_received_to_firetext(client):
|
def test_receive_notification_returns_received_to_firetext(client):
|
||||||
data = {"some": "thing"}
|
data = "source=07999999999&destination=07111111111&message=this is a message&time=2017-01-01 12:00:00"
|
||||||
|
|
||||||
response = client.post(
|
response = client.post(
|
||||||
path='/notifications/sms/receive/firetext',
|
path='/notifications/sms/receive/firetext',
|
||||||
data=json.dumps(data),
|
data=data,
|
||||||
headers=[('Content-Type', 'application/json')])
|
headers=[('Content-Type', 'application/x-www-form-urlencoded')])
|
||||||
|
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
result = json.loads(response.get_data(as_text=True))
|
result = json.loads(response.get_data(as_text=True))
|
||||||
|
|||||||
Reference in New Issue
Block a user