Esempio n. 1
0
 def test_confirm_account_bad_token_or_wrong_user(self, app):
     """confirm_account returns false if token is bad or for wrong user."""
     user1 = User()
     user1.id = 42
     user2 = User()
     user2.id = 33
     token = user1.generate_account_confirmation_token()
     assert not user2.confirm_account(token)
     assert not user1.confirm_account('badtoken')
Esempio n. 2
0
 def test_confirm_account_works_with_generated_token(self, app):
     """confirm_account should return True if given a valid token."""
     user = User()
     user.id = 42
     token = user.generate_account_confirmation_token()
     assert user.confirm_account(token)