def password(self, new_plain_password): if new_plain_password: if len(new_plain_password ) < 6: # TODO: Restrict with Regular expression? raise InvalidNameException( "Password must have at least 6 characters") self._encrypted_password = encrypt(new_plain_password) self.password_timestamp = time.time()
def test_encrypt2(self): p1 = encrypt("prueba") assert verify("prueba", p1) assert verify( "111111", "biicode$E4IwJiQEwJgzRkiJcc7Z2w$t7XxsRJrXnPeQmyfNtyNvh32xK2WTSiguCv5j9Nxh6A44lXTOoSjvHTfW2Vbdpi9YlOPypDo6Z1ssGnRizfk/g" )
def test_encrypt1(self): encrypted = encrypt("mandanga") self.assertTrue(verify("mandanga", encrypted)) self.assertFalse(verify("", ""))
def test_encrypt2(self): p1 = encrypt("prueba") assert verify("prueba", p1) assert verify("111111", "biicode$E4IwJiQEwJgzRkiJcc7Z2w$t7XxsRJrXnPeQmyfNtyNvh32xK2WTSiguCv5j9Nxh6A44lXTOoSjvHTfW2Vbdpi9YlOPypDo6Z1ssGnRizfk/g")
def password(self, new_plain_password): if new_plain_password: if len(new_plain_password) < 6: # TODO: Restrict with Regular expression? raise InvalidNameException("Password must have at least 6 characters") self._encrypted_password = encrypt(new_plain_password) self.password_timestamp = time.time()