def testGenerateToken_CanNotBeValidatedWithDifferentUser(self): self.SetCurrentUser('*****@*****.**', user_id='x') token = xsrf.GenerateToken(users.get_current_user()) self.SetCurrentUser('*****@*****.**', user_id='y') self.assertFalse(xsrf._ValidateToken(token, users.get_current_user()))
def testGenerateToken_CanBeValidatedWithSameUser(self): self.SetCurrentUser('*****@*****.**') token = xsrf.GenerateToken(users.get_current_user()) self.assertTrue(xsrf._ValidateToken(token, users.get_current_user()))
def testGenerateToken_CanBeValidatedWithSameUser(self): token = xsrf.GenerateToken(users.get_current_user()) self.assertTrue(xsrf._ValidateToken(token, users.get_current_user()))
def testGenerateToken_CanNotBeValidatedWithDifferentUser(self): token = xsrf.GenerateToken(users.get_current_user()) self.SetCurrentUser('*****@*****.**', user_id='y') self.assertFalse(xsrf._ValidateToken(token, users.get_current_user()))