Added 2 more asserts to test_post_token for Bearer & Basic.

This commit is contained in:
Sean Parsons 2016-12-25 18:35:29 -05:00
parent 8220515e72
commit a4ed6a3923

View File

@ -134,6 +134,32 @@ def test_post_token():
assert request.token == token assert request.token == token
assert response.text == 'OK' assert response.text == 'OK'
# uuid4 generated token.
token = 'a1d895e0-553a-421a-8e22'
headers = {
'content-type': 'application/json',
'Authorization': 'Bearer {}'.format(token)
}
request, response = sanic_endpoint_test(app, data=json_dumps(payload), headers=headers)
assert request.token == token
assert response.text == 'OK'
# uuid4 generated token.
token = '421a-8e22-5ff8ecb48cbf'
headers = {
'content-type': 'application/json',
'Authorization': 'Basic {}'.format(token)
}
request, response = sanic_endpoint_test(app, data=json_dumps(payload), headers=headers)
assert request.token == token
assert response.text == 'OK'
def test_post_form_urlencoded(): def test_post_form_urlencoded():
app = Sanic('test_post_form_urlencoded') app = Sanic('test_post_form_urlencoded')