def test_different_password_different_token(self):
     """
     If a user has a different password hash, it will have a different
     token.
     """
     user_1 = User(email='email', password_hash='password_hash')
     user_2 = User(email='email', password_hash='different_hash')
     with app.app_context():
         self.assertNotEqual(user_1.get_auth_token(),
                             user_2.get_auth_token())
Beispiel #2
0
 def test_different_password_different_token(self):
     """
     If a user has a different password hash, it will have a different
     token.
     """
     user_1 = User(email='email', password_hash='password_hash')
     user_2 = User(email='email', password_hash='different_hash')
     with app.app_context():
         self.assertNotEqual(user_1.get_auth_token(),
                             user_2.get_auth_token())
 def test_get_auth_token(self):
     """
     Authentication tokens are created using Flask-Login's
     ``make_secure_token`` function and the email address and password of
     the user.
     """
     user = User(email='email', password_hash='password_hash')
     with app.app_context():
         self.assertEqual(user.get_auth_token(),
                          make_secure_token('email', 'password_hash'))
Beispiel #4
0
 def test_get_auth_token(self):
     """
     Authentication tokens are created using Flask-Login's
     ``make_secure_token`` function and the email address and password of
     the user.
     """
     user = User(email='email', password_hash='password_hash')
     with app.app_context():
         self.assertEqual(user.get_auth_token(),
                          make_secure_token('email', 'password_hash'))