Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit e6152ed

Browse files
committed
Changed HTTP_AUTHORIZATION string format
1 parent ce60e47 commit e6152ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rest_framework_jwt/test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from rest_framework.test import APITestCase, APIClient
22
from rest_framework import status
3+
from rest_framework_jwt.settings import api_settings
34

45

56
class APIJWTClient(APIClient):
@@ -11,7 +12,8 @@ def login(self, username, password):
1112
response = self.post('/api-token-auth/', {"username": username, "password": password},
1213
format='json')
1314
if response.status_code == status.HTTP_200_OK:
14-
self.credentials(HTTP_AUTHORIZATION='JWT ' + response.data['token'])
15+
self.credentials(
16+
HTTP_AUTHORIZATION="{0} {1}".format(api_settings.JWT_AUTH_HEADER_PREFIX, response.data['token']))
1517

1618
return True
1719
else:

0 commit comments

Comments
 (0)