'Tests that the wiki is successfully created for courses that have
very long course ids.'

@patch.dict('django.conf.settings.FEATURES', {'ALLOW_WIKI_ROOT_ACCESS': True})
def test_create_wiki_with_long_course_id(self):

    org = 'a-very-long-org-name'
    course = 'a-very-long-course-name'
    display_name = 'very-long-display-name'
    wiki_slug = '{0}.{1}.{2}'.format(org, course, display_name)
    self.assertEqual(len(((org + course) + display_name)), 65)
    course = CourseFactory.create(org=org, course=course, display_name=display_name, wiki_slug=wiki_slug)
    self.login(self.student, self.password)
    self.enroll(course)
    self.create_course_page(course)
    course_wiki_page = reverse('wiki:get', kwargs={'path': (course.wiki_slug + '/')})
    referer = reverse('courseware', kwargs={'course_id': course.id.to_deprecated_string()})
    resp = self.client.get(course_wiki_page, follow=True, HTTP_REFERER=referer)
    self.assertEqual(resp.status_code, 200)
