def test_change_password_success(self): old_password = '******' stored_password = PasswordHelper.create_password(old_password) new_password = '******' result = PasswordHelper.change_password(stored_password, old_password, new_password) self.assertTrue(result.success) self.assertIsInstance(result.new_password, str, 'New password to store after changing password not returned') self.assertTrue(result.new_password, 'New password not returned')
def test_change_password_fail(self): actual_password = '******' stored_password = PasswordHelper.create_password(actual_password) incorrect_password = '******' new_password = '******' result = PasswordHelper.change_password(stored_password, incorrect_password, new_password) self.assertFalse(result.success) self.assertEqual(result.new_password, stored_password, 'No new password should be needed')
def test_change_password_success(self): old_password = '******' stored_password = PasswordHelper.create_password(old_password) new_password = '******' result = PasswordHelper.change_password(stored_password, old_password, new_password) self.assertTrue(result.success) self.assertIsInstance( result.new_password, str, 'New password to store after changing password not returned') self.assertTrue(result.new_password, 'New password not returned')
def test_change_password_fail(self): actual_password = '******' stored_password = PasswordHelper.create_password(actual_password) incorrect_password = '******' new_password = '******' result = PasswordHelper.change_password(stored_password, incorrect_password, new_password) self.assertFalse(result.success) self.assertEqual(result.new_password, stored_password, 'No new password should be needed')