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

Commit bddba72

Browse files
committed
Add test to try and reproduce #33
1 parent 1aec8fb commit bddba72

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_views.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@ def test_jwt_login_with_expired_token(self):
113113
self.assertEqual(response.status_code, status.HTTP_200_OK)
114114
self.assertEqual(decoded_payload['username'], self.username)
115115

116+
def test_jwt_login_using_zero(self):
117+
"""
118+
Test to reproduce issue #33
119+
"""
120+
client = APIClient(enforce_csrf_checks=True)
121+
122+
data = {
123+
'username': '0',
124+
'password': '0'
125+
}
126+
127+
response = client.post('/auth-token/', data, format='json')
128+
129+
self.assertEqual(response.status_code, 400)
130+
116131

117132
@unittest.skipIf(get_version() < '1.5.0', 'No Configurable User model feature')
118133
@override_settings(AUTH_USER_MODEL='tests.CustomUser')

0 commit comments

Comments
 (0)