'Assert that when unenrolled user tries to access CCX do not allow the user to self-register.
Redirect him to his student dashboard'

def test_redirect_to_dashboard_unenrolled_ccx(self):

    ccx = CcxFactory(course_id=self.course.id, coach=self.coach)
    ccx_locator = CCXLocator.from_course_locator(self.course.id, unicode(ccx.id))
    self.setup_user()
    url = reverse('info', args=[ccx_locator])
    response = self.client.get(url)
    expected = reverse('dashboard')
    self.assertRedirects(response, expected, status_code=302, target_status_code=200)
