diff --git a/lms/djangoapps/discussion/django_comment_client/tests/test_middleware.py b/lms/djangoapps/discussion/django_comment_client/tests/test_middleware.py index 49f2d950fc..6e23ef2881 100644 --- a/lms/djangoapps/discussion/django_comment_client/tests/test_middleware.py +++ b/lms/djangoapps/discussion/django_comment_client/tests/test_middleware.py @@ -30,7 +30,7 @@ class AjaxExceptionTestCase(TestCase): self.assertEqual(self.exception1.status_code, response1.status_code) self.assertEqual( {"errors": json.loads(text_type(self.exception1))}, - json.loads(response1.content) + json.loads(response1.content.decode('utf-8')) ) response2 = self.a.process_exception(self.request1, self.exception2) @@ -38,7 +38,7 @@ class AjaxExceptionTestCase(TestCase): self.assertEqual(self.exception2.status_code, response2.status_code) self.assertEqual( {"errors": [text_type(self.exception2)]}, - json.loads(response2.content) + json.loads(response2.content.decode('utf-8')) ) self.assertIsNone(self.a.process_exception(self.request1, self.exception0)) diff --git a/lms/djangoapps/instructor/tests/test_tools.py b/lms/djangoapps/instructor/tests/test_tools.py index 9ab7ac689d..1072f2acea 100644 --- a/lms/djangoapps/instructor/tests/test_tools.py +++ b/lms/djangoapps/instructor/tests/test_tools.py @@ -33,7 +33,7 @@ class TestDashboardError(unittest.TestCase): """ def test_response(self): error = tools.DashboardError(u'Oh noes!') - response = json.loads(error.response().content) + response = json.loads(error.response().content.decode('utf-8')) self.assertEqual(response, {'error': 'Oh noes!'}) @@ -50,7 +50,7 @@ class TestHandleDashboardError(unittest.TestCase): """ raise tools.DashboardError("Oh noes!") - response = json.loads(view(None, None).content) + response = json.loads(view(None, None).content.decode('utf-8')) self.assertEqual(response, {'error': 'Oh noes!'}) def test_no_error(self):