'Ensure that a user accessing a non-live course sees a redirect to
the student dashboard, not a 404, even if the localized date is unicode'

@mock.patch.dict(settings.FEATURES, {'DISABLE_START_DATES': False})
@mock.patch('util.date_utils.strftime_localized')
def test_non_live_course_other_language(self, mock_strftime_localized):

    future_course = self.create_future_course()
    self.user = self.create_user_for_course(future_course, CourseUserType.ENROLLED)
    fake_unicode_start_time = u'\xfc\xf1\xee\xe7\xf8\u2202\xe9_\xdft\xe5\xaet_t\xee\xb5\xe9'
    mock_strftime_localized.return_value = fake_unicode_start_time
    url = course_home_url(future_course)
    response = self.client.get(url)
    expected_params = QueryDict(mutable=True)
    expected_params['notlive'] = fake_unicode_start_time
    expected_url = u'{url}?{params}'.format(url=reverse('dashboard'), params=expected_params.urlencode())
    self.assertRedirects(response, expected_url)
