def test_valid_old_password(self): hsh = hashlib.md5(encoding.smart_str(self.utf)).hexdigest() u = UserProfile(password=hsh) assert u.check_password(self.utf) is True # Make sure we updated the old password. algo, salt, hsh = u.password.split('$') eq_(algo, 'sha512') eq_(hsh, get_hexdigest(algo, salt, self.utf))
def test_valid_old_password(self): hsh = hashlib.md5('sekrit').hexdigest() u = UserProfile(password=hsh) assert u.check_password('sekrit') is True # Make sure we updated the old password. algo, salt, hsh = u.password.split('$') eq_(algo, 'sha512') eq_(hsh, get_hexdigest(algo, salt, 'sekrit'))