'Verify that enrolled students are redirected to the Enterprise consent
URL if a linked Enterprise Customer requires data sharing consent
and it has not yet been provided.'

@patch('openedx.features.enterprise_support.api.get_enterprise_consent_url')
def test_redirection_missing_enterprise_consent(self, mock_get_url):

    mock_get_url.return_value = reverse('dashboard')
    self.login(self.enrolled_user)
    url = reverse('courseware', kwargs={'course_id': self.course.id.to_deprecated_string()})
    response = self.client.get(url)
    self.assertRedirects(response, reverse('dashboard'))
    mock_get_url.assert_called_once()
    mock_get_url.return_value = None
    response = self.client.get(url)
    self.assertNotIn('You    are    not    currently    enrolled    in    this    course', response.content)
