Exemple #1
0
 def test_change_password(self):
     user = UserModel(username='******', password='******')
     db.session.add(user)
     db.session.commit()
     self.assertTrue(user.check_password('Password2'))
     user.change_password('Password3')
     self.assertTrue(user.check_password('Password3'))
     self.assertTrue(user.updated_by == user.public_id)
     user.change_password('Password4', principal='SYSTEM')
     self.assertTrue(user.check_password('Password4'))
     self.assertTrue(user.updated_by == 'SYSTEM')
Exemple #2
0
 def test_check_password(self):
     user = UserModel(username='******', password='******')
     db.session.add(user)
     db.session.commit()
     self.assertTrue(user.check_password('Password2'))
     self.assertFalse(user.check_password('Pass23word'))