Blacked the code

This commit is contained in:
Eliot Berriot 2018-06-09 15:36:16 +02:00
parent b6fc0051fa
commit 62ca3bd736
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
279 changed files with 8861 additions and 9527 deletions

View file

@ -5,18 +5,15 @@ jwt_payload_handler = api_settings.JWT_PAYLOAD_HANDLER
jwt_encode_handler = api_settings.JWT_ENCODE_HANDLER
def test_can_authenticate_using_token_param_in_url(
factories, preferences, client):
user = factories['users.User']()
preferences['common__api_authentication_required'] = True
url = reverse('api:v1:tracks-list')
def test_can_authenticate_using_token_param_in_url(factories, preferences, client):
user = factories["users.User"]()
preferences["common__api_authentication_required"] = True
url = reverse("api:v1:tracks-list")
response = client.get(url)
assert response.status_code == 401
payload = jwt_payload_handler(user)
token = jwt_encode_handler(payload)
response = client.get(url, data={
'jwt': token
})
response = client.get(url, data={"jwt": token})
assert response.status_code == 200