'Verify that users viewing the course info who are enrolled, but have not provided
data sharing consent, are first redirected to a consent page, and then, once they\'ve
provided consent, are able to view the course info.'

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

    self.setup_user()
    self.enroll(self.course)
    mock_get_url.return_value = reverse('dashboard')
    url = reverse('info', args=[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)
