def test_set_password(self): """Check password setter correctness""" raw_pass = '******' instance = Mock(password=None) bl = UserBL(instance) bl.set_password(raw_pass) self.assertIsNotNone(instance.password) self.assertTrue(check_password_hash(instance.password, raw_pass))
def test_set_password(self): """Check password setter correctness""" raw_pass = "******" instance = Mock(password=None) bl = UserBL(instance) bl.set_password(raw_pass) self.assertIsNotNone(instance.password) self.assertTrue(check_password_hash(instance.password, raw_pass))
def test_reset_password_bad_token(self, send_mail): fake_token = '-1!~ -2' is_success = UserBL.reset_password(fake_token) self.assertFalse( is_success, msg='resetToken succeeded on bad token', ) self.assertFalse( send_mail.called, msg='send_mail was called, while it shouldn\'t' )
def test_reset_password_bad_token(self, send_mail): fake_token = "-1!~ -2" is_success = UserBL.reset_password(fake_token) self.assertFalse(is_success, msg="resetToken succeeded on bad token") self.assertFalse(send_mail.called, msg="send_mail was called, while it shouldn't")