def test_correct_legacy_password(self): new_password = '******' guess_password = '******' result = PasswordHelper.validate_password(new_password, guess_password, legacy_validator=self.old_comparator) self.assertTrue(result.success, 'Correct password not valid') self.assertTrue(result.new_password, 'Upgrade to legacy password not supplied')
def test_invalid_password(self): new_password = '******' stored_password = PasswordHelper.create_password(new_password) guess_password = '******' result = PasswordHelper.validate_password(stored_password, guess_password) self.assertFalse(result.success, 'Incorrect password was found valid') self.assertEqual(result.new_password, stored_password, 'No new password should be needed')
def test_valid_password(self): new_password = '******' stored_password = PasswordHelper.create_password(new_password) guess_password = '******' result = PasswordHelper.validate_password(stored_password, guess_password) self.assertTrue(result.success, 'Correct password not valid') self.assertEqual(result.new_password, stored_password, 'No new password should be needed')
def test_incorrect_legacy_password(self): new_password = '******' guess_password = '******' result = PasswordHelper.validate_password(new_password, guess_password, legacy_validator=self.old_comparator) self.assertFalse(result.success, 'Correct password not valid') self.assertFalse(result.new_password, 'No new password should be needed')
def test_correct_legacy_password(self): new_password = '******' guess_password = '******' result = PasswordHelper.validate_password( new_password, guess_password, legacy_validator=self.old_comparator) self.assertTrue(result.success, 'Correct password not valid') self.assertTrue(result.new_password, 'Upgrade to legacy password not supplied')
def test_invalid_password(self): new_password = '******' stored_password = PasswordHelper.create_password(new_password) guess_password = '******' result = PasswordHelper.validate_password(stored_password, guess_password) self.assertFalse(result.success, 'Incorrect password was found valid') self.assertEqual(result.new_password, stored_password, 'No new password should be needed')
def test_valid_password(self): new_password = '******' stored_password = PasswordHelper.create_password(new_password) guess_password = '******' result = PasswordHelper.validate_password(stored_password, guess_password) self.assertTrue(result.success, 'Correct password not valid') self.assertEqual(result.new_password, stored_password, 'No new password should be needed')
def test_incorrect_legacy_password(self): new_password = '******' guess_password = '******' result = PasswordHelper.validate_password( new_password, guess_password, legacy_validator=self.old_comparator) self.assertFalse(result.success, 'Correct password not valid') self.assertFalse(result.new_password, 'No new password should be needed')