'Verify that the wrapped function returns a redirect to the consent URL when enterprise integration is enabled,
and course consent is required.'

@mock.patch('openedx.features.enterprise_support.api.enterprise_enabled')
@mock.patch('openedx.features.enterprise_support.api.consent_necessary_for_course')
@mock.patch('openedx.features.enterprise_support.api.get_enterprise_consent_url')
def test_data_consent_required(self, mock_get_consent_url, mock_consent_necessary, mock_enterprise_enabled):

    mock_enterprise_enabled.return_value = True
    mock_consent_necessary.return_value = True
    consent_url = '/abc/def'
    mock_get_consent_url.return_value = consent_url
    self.check_data_sharing_consent(consent_required=True, consent_url=consent_url)
    mock_get_consent_url.assert_called_once()
    mock_enterprise_enabled.assert_called_once()
    mock_consent_necessary.assert_called_once()
