diff --git a/cms/djangoapps/contentstore/views/tests/test_container_page.py b/cms/djangoapps/contentstore/views/tests/test_container_page.py index 67ea4dc905..daf7e49bcf 100644 --- a/cms/djangoapps/contentstore/views/tests/test_container_page.py +++ b/cms/djangoapps/contentstore/views/tests/test_container_page.py @@ -67,8 +67,12 @@ class ContainerPageTestCase(StudioPageTestCase, LibraryTestCase): u'Lesson 1' ).format( course=re.escape(six.text_type(self.course.id)), - section_parameters=re.escape(u'?show={}'.format(http.urlquote(self.chapter.location))), - subsection_parameters=re.escape(u'?show={}'.format(http.urlquote(self.sequential.location))), + section_parameters=re.escape(u'?show={}'.format(http.urlquote( + str(self.chapter.location).encode() + ))), + subsection_parameters=re.escape(u'?show={}'.format(http.urlquote( + str(self.sequential.location).encode() + ))), ), ) @@ -93,7 +97,9 @@ class ContainerPageTestCase(StudioPageTestCase, LibraryTestCase): ).format( course=re.escape(six.text_type(self.course.id)), unit_parameters=re.escape(str(self.vertical.location)), - subsection_parameters=re.escape(u'?show={}'.format(http.urlquote(self.sequential.location))), + subsection_parameters=re.escape(u'?show={}'.format(http.urlquote( + str(self.sequential.location).encode() + ))), ), ) diff --git a/cms/djangoapps/contentstore/views/tests/test_helpers.py b/cms/djangoapps/contentstore/views/tests/test_helpers.py index 8c38ad02cb..1f2799ecbd 100644 --- a/cms/djangoapps/contentstore/views/tests/test_helpers.py +++ b/cms/djangoapps/contentstore/views/tests/test_helpers.py @@ -27,7 +27,7 @@ class HelpersTestCase(CourseTestCase): display_name="Week 1") self.assertEqual( xblock_studio_url(chapter), - u'{}?show={}'.format(course_url, http.urlquote(chapter.location)) + u'{}?show={}'.format(course_url, http.urlquote(str(chapter.location).encode())) ) # Verify sequential URL @@ -35,7 +35,7 @@ class HelpersTestCase(CourseTestCase): display_name="Lesson 1") self.assertEqual( xblock_studio_url(sequential), - u'{}?show={}'.format(course_url, http.urlquote(sequential.location)) + u'{}?show={}'.format(course_url, http.urlquote(str(sequential.location).encode())) ) # Verify unit URL