'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):

    future_course = self.create_future_course()
    self.user = self.create_user_for_course(future_course, CourseUserType.ENROLLED)
    url = course_home_url(future_course)
    response = self.client.get(url)
    start_date = strftime_localized(future_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)
