accept token directly in auth header
This commit is contained in:
		| @@ -141,6 +141,16 @@ def test_token(): | ||||
|         return text('OK') | ||||
|  | ||||
|     # uuid4 generated token. | ||||
|     token = 'a1d895e0-553a-421a-8e22-5ff8ecb48cbf' | ||||
|     headers = { | ||||
|         'content-type': 'application/json', | ||||
|         'Authorization': '{}'.format(token) | ||||
|     } | ||||
|  | ||||
|     request, response = app.test_client.get('/', headers=headers) | ||||
|  | ||||
|     assert request.token == token | ||||
|  | ||||
|     token = 'a1d895e0-553a-421a-8e22-5ff8ecb48cbf' | ||||
|     headers = { | ||||
|         'content-type': 'application/json', | ||||
| @@ -151,6 +161,18 @@ def test_token(): | ||||
|  | ||||
|     assert request.token == token | ||||
|  | ||||
|     token = 'a1d895e0-553a-421a-8e22-5ff8ecb48cbf' | ||||
|     headers = { | ||||
|         'content-type': 'application/json', | ||||
|         'Authorization': 'Bearer Token {}'.format(token) | ||||
|     } | ||||
|  | ||||
|     request, response = app.test_client.get('/', headers=headers) | ||||
|  | ||||
|     assert request.token == token | ||||
|  | ||||
|  | ||||
|  | ||||
| # ------------------------------------------------------------ # | ||||
| #  POST | ||||
| # ------------------------------------------------------------ # | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Raphael Deem
					Raphael Deem