'Checks that the task is aborted if any relevant api configs are
disabled.'

@ddt.data(('credentials', 'enable_learner_issuance'))
@ddt.unpack
def test_retry_if_config_disabled(self, disabled_config_type, disabled_config_attribute, *mock_helpers):

    getattr(self, 'create_{}_config'.format(disabled_config_type))(**{disabled_config_attribute: False})
    with mock.patch((TASKS_MODULE + '.LOGGER.warning')) as mock_warning:
        with self.assertRaises(MaxRetriesExceededError):
            tasks.award_program_certificates.delay(self.student.username).get()
        self.assertTrue(mock_warning.called)
    for mock_helper in mock_helpers:
        self.assertFalse(mock_helper.called)
