def password(self, plain_password): self._salt, self._password = Utils.hash_password(plain_password)
def test_check_valid_hash_and_plain_password(self): s_salt, s_password = Utils.hash_password(self.password) isCheck = Utils.verify_password(s_salt, s_password, self.password) self.assertTrue(isCheck)
def test_check_hash_and_invalid_plain_password(self): invalid_password = "******" s_salt, s_password = Utils.hash_password(self.password) isCheck = Utils.verify_password(s_salt, s_password, invalid_password) self.assertFalse(isCheck)
def test_hash_password_is_not_none(self): salt, password = Utils.hash_password(self.password) self.assertIsNotNone(salt) self.assertIsNotNone(password)