Ejemplo n.º 1
0
 def testVerifyPassword(self):
     user = User()
     user.password = "******"
     self.assertTrue(user.verifyPassword("abcabc"))
Ejemplo n.º 2
0
 def testGetPassword(self):
     # 试图get会抛异常
     user = User()
     user.password = "******"
     with self.assertRaises(AttributeError):
         user.password
Ejemplo n.º 3
0
 def testSetPassword(self):
     user = User()
     user.password = "******"
     self.assertTrue(user.passwordHash is not None)