3
0
Fork 0

fix: add check_user_password() method for auth handler

This commit is contained in:
Lance Edgar 2024-07-18 10:27:31 -05:00
parent 9fc7dbe1f7
commit c424a6cd8a
2 changed files with 32 additions and 10 deletions

View file

@ -60,6 +60,17 @@ else:
user = self.handler.authenticate_user(self.session, 'barney', 'goodpass')
self.assertIsNone(user)
def test_check_user_password(self):
model = self.app.model
barney = model.User(username='barney')
self.handler.set_user_password(barney, 'goodpass')
self.session.add(barney)
self.session.commit()
# basics
self.assertTrue(self.handler.check_user_password(barney, 'goodpass'))
self.assertFalse(self.handler.check_user_password(barney, 'BADPASS'))
def test_get_role(self):
model = self.app.model
myrole = model.Role(name="My Role")