-
-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Martin Bauer
committed
Feb 26, 2018
1 parent
3927e3a
commit 65ebb2b
Showing
1 changed file
with
1 addition
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,8 +123,7 @@ def test_invalid_token_length_returns_401_code(self): | |
self.assertEqual(response.data, {"detail": "Invalid token."}) | ||
|
||
def test_invalid_odd_length_token_returns_401_code(self): | ||
user = User.objects.create_user('john.doe', '[email protected]', 'test_pwd') | ||
token = AuthToken.objects.create(user) | ||
token = AuthToken.objects.create(self.user) | ||
odd_length_token = token + '1' | ||
url = reverse('api-root') | ||
self.client.credentials(HTTP_AUTHORIZATION=('Token %s' % odd_length_token)) | ||
|