Refactor to use query string rather than path params

This commit is contained in:
Ken Tsang
2017-11-07 16:39:11 +00:00
parent ac15e7fd8b
commit dca331e3ea
4 changed files with 68 additions and 71 deletions

View File

@@ -6,6 +6,7 @@ from app.v2.inbound_sms.inbound_sms_schemas import get_inbound_sms_response, get
from app.schema_validation import validate
from tests import create_authorization_header
from tests.app.db import create_inbound_sms
valid_inbound_sms = {
@@ -44,7 +45,7 @@ invalid_inbound_sms_list = {
def test_get_inbound_sms_contract(client, sample_inbound_sms):
auth_header = create_authorization_header(service_id=sample_inbound_sms.service_id)
response = client.get('/v2/received-text-messages/{}'.format(sample_inbound_sms.user_number), headers=[auth_header])
response = client.get('/v2/received-text-messages', headers=[auth_header])
response_json = json.loads(response.get_data(as_text=True))
assert validate(response_json, get_inbound_sms_response)['received_text_messages'][0] \