From 929d73bd8815bf619c0eb080125fdac15e163d5b Mon Sep 17 00:00:00 2001 From: aarif Date: Tue, 3 Sep 2019 20:33:22 +0500 Subject: [PATCH] python 3 fixes --- lms/djangoapps/mobile_api/course_info/tests.py | 2 +- openedx/core/lib/xblock_utils/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/mobile_api/course_info/tests.py b/lms/djangoapps/mobile_api/course_info/tests.py index caf43b2c18..bcb5adccde 100644 --- a/lms/djangoapps/mobile_api/course_info/tests.py +++ b/lms/djangoapps/mobile_api/course_info/tests.py @@ -75,7 +75,7 @@ class TestUpdates(MobileAPITestCase, MobileAuthTestMixin, MobileCourseAccessTest response = self.api_response(api_version=api_version) # verify static URLs are replaced in the content returned by the API - self.assertNotIn("\"/static/", response.content) + self.assertNotIn("\"/static/", response.content.decode('utf-8')) # verify static URLs remain in the underlying content underlying_updates = modulestore().get_item(updates_usage_key) diff --git a/openedx/core/lib/xblock_utils/__init__.py b/openedx/core/lib/xblock_utils/__init__.py index 0217a55b16..0bd47f6d35 100644 --- a/openedx/core/lib/xblock_utils/__init__.py +++ b/openedx/core/lib/xblock_utils/__init__.py @@ -434,7 +434,7 @@ def get_course_update_items(course_updates, provided_index=0): content = html_parsed[0].tail else: content = html_parsed[0].tail if html_parsed[0].tail is not None else "" - content += "\n".join([html.tostring(ele) for ele in html_parsed[1:]]) + content += "\n".join([html.tostring(ele).decode('utf-8') for ele in html_parsed[1:]]) return content if course_updates and getattr(course_updates, "items", None):