def password(self, password): """Automatically generates the hashed password and salt when set. Args: string password: The password to set. """ _pass, salt = authentication.generate_password(password) self._password = _pass self.salt = salt
def test_generate_password(self): password, salt = authentication.generate_password('test', 10) assert password assert salt
def test_check_password(self): password, salt = authentication.generate_password('test', 10) assert authentication.check_password('test', password, salt) assert not authentication.check_password('testing', password, salt)