Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Make webapp2_extras/appengine/auth/models.User.validate_token return … #109

Merged
merged 1 commit into from
Apr 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/extras_appengine_auth_models_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ def test_user_token(self):
auth_id = 'foo'

token = m.create_auth_token(auth_id)
self.assertTrue(m.validate_auth_token(auth_id, token))
self.assertIsNotNone(m.validate_auth_token(auth_id, token))
m.delete_auth_token(auth_id, token)
self.assertFalse(m.validate_auth_token(auth_id, token))
self.assertIsNone(m.validate_auth_token(auth_id, token))

token = m.create_signup_token(auth_id)
self.assertTrue(m.validate_signup_token(auth_id, token))
self.assertIsNotNone(m.validate_signup_token(auth_id, token))
m.delete_signup_token(auth_id, token)
self.assertFalse(m.validate_signup_token(auth_id, token))
self.assertIsNone(m.validate_signup_token(auth_id, token))


class TestUniqueModel(test_base.BaseTestCase):
Expand Down
2 changes: 1 addition & 1 deletion webapp2_extras/appengine/auth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def validate_token(cls, user_id, subject, token):
A :class:`UserToken` or None if the token does not exist.
"""
return cls.token_model.get(user=user_id, subject=subject,
token=token) is not None
token=token)

@classmethod
def create_auth_token(cls, user_id):
Expand Down