'Ensure that a user accessing a non-live course sees a redirect to
the student dashboard, not a 404.'

@mock.patch.dict(settings.FEATURES, {'DISABLE_START_DATES': False})
def test_non_live_course(self):

    self.setup_user()
    self.enroll(self.course)
    url = reverse('info', args=[unicode(self.course.id)])
    response = self.client.get(url)
    start_date = strftime_localized(self.course.start, 'SHORT_DATE')
    expected_params = QueryDict(mutable=True)
    expected_params['notlive'] = start_date
    expected_url = '{url}?{params}'.format(url=reverse('dashboard'), params=expected_params.urlencode())
    self.assertRedirects(response, expected_url)
