Ejemplo n.º 1
0
 def test_password(self):
     u = User(username='******',
              email='*****@*****.**',
              password='******')
     self.assertTrue(u.password_hash is not None)
     self.assertTrue(u.check_password('password'))
     self.assertFalse(u.check_password('fake_password'))
Ejemplo n.º 2
0
 def test_password_hashing(self):
     u = User(username='******')
     u.set_password('cat')
     self.assertFalse(u.check_password('cheese'))
     self.assertTrue(u.check_password('cat'))