Skip to content

Commit

Permalink
Add additional token auth test
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Mar 13, 2016
1 parent 96b5764 commit 29edb19
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ def test_token_auth_login_invalid_scheme(self):
self.assertEqual(response.headers['WWW-Authenticate'],
'MyToken realm="Foo"')

def test_token_auth_login_invalid_header(self):
response = self.client.get(
'/protected', headers={'Authorization': 'this-is-a-bad-header'})
self.assertEqual(response.status_code, 401)
self.assertTrue('WWW-Authenticate' in response.headers)
self.assertEqual(response.headers['WWW-Authenticate'],
'MyToken realm="Foo"')

def test_token_auth_login_invalid_no_callback(self):
token_auth2 = HTTPTokenAuth('Token', realm='foo')

Expand Down

0 comments on commit 29edb19

Please sign in to comment.