Commit c5f4ba0f by Matjaz Gregoric

Upgrade django-wiki to 0.0.9.

The new version fixes a problem where wiki fails with a 500 error when
combined org/course name/course run fields are longer than 50
characters.
parent c85d1a6d
......@@ -86,11 +86,11 @@ class WikiRedirectTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
"""
course_wiki_home = reverse('course_wiki', kwargs={'course_id': course.id.to_deprecated_string()})
referer = reverse("progress", kwargs={'course_id': self.toy.id.to_deprecated_string()})
referer = reverse("progress", kwargs={'course_id': course.id.to_deprecated_string()})
resp = self.client.get(course_wiki_home, follow=True, HTTP_REFERER=referer)
course_wiki_page = referer.replace('progress', 'wiki/' + self.toy.wiki_slug + "/")
course_wiki_page = referer.replace('progress', 'wiki/' + course.wiki_slug + "/")
ending_location = resp.redirect_chain[-1][0]
......@@ -167,3 +167,32 @@ class WikiRedirectTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
resp = self.client.get(course_wiki_page, follow=True)
target_url, __ = resp.redirect_chain[-1]
self.assertIn(reverse('signin_user'), target_url)
@patch.dict("django.conf.settings.FEATURES", {'ALLOW_WIKI_ROOT_ACCESS': True})
def test_create_wiki_with_long_course_id(self):
"""
Tests that the wiki is successfully created for courses that have
very long course ids.
"""
# Combined course key length is currently capped at 65 characters (see MAX_SUM_KEY_LENGTH
# in /common/static/common/js/components/utils/view_utils.js).
# The below key components combined are exactly 65 characters long.
org = 'a-very-long-org-name'
course = 'a-very-long-course-name'
display_name = 'very-long-display-name'
# This is how wiki_slug is generated in cms/djangoapps/contentstore/views/course.py.
wiki_slug = "{0}.{1}.{2}".format(org, course, display_name)
self.assertEqual(len(org + course + display_name), 65) # sanity check
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)
......@@ -47,7 +47,7 @@
# Third-party:
git+https://github.com/cyberdelia/django-pipeline.git@1.5.3#egg=django-pipeline==1.5.3
git+https://github.com/edx/django-wiki.git@v0.0.8#egg=django-wiki==0.0.8
git+https://github.com/edx/django-wiki.git@v0.0.9#egg=django-wiki==0.0.9
git+https://github.com/edx/django-openid-auth.git@0.8#egg=django-openid-auth==0.8
git+https://github.com/edx/MongoDBProxy.git@25b99097615bda06bd7cdfe5669ed80dc2a7fed0#egg=MongoDBProxy==0.1.0
git+https://github.com/edx/nltk.git@2.0.6#egg=nltk==2.0.6
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment