diff --git a/common/lib/xmodule/xmodule/error_module.py b/common/lib/xmodule/xmodule/error_module.py index 8014234f69..7f15370176 100644 --- a/common/lib/xmodule/xmodule/error_module.py +++ b/common/lib/xmodule/xmodule/error_module.py @@ -121,7 +121,7 @@ class ErrorDescriptor(ErrorFields, JSONEditingDescriptor): def from_descriptor(cls, descriptor, error_msg='Error not available'): return cls._construct( descriptor.system, - descriptor._model_data, + str(descriptor), error_msg, location=descriptor.location, ) diff --git a/common/lib/xmodule/xmodule/tests/test_error_module.py b/common/lib/xmodule/xmodule/tests/test_error_module.py index b329b4b5cc..78e5b46a96 100644 --- a/common/lib/xmodule/xmodule/tests/test_error_module.py +++ b/common/lib/xmodule/xmodule/tests/test_error_module.py @@ -43,7 +43,7 @@ class TestErrorModule(unittest.TestCase): module = error_descriptor.xmodule(self.system) rendered_html = module.get_html() self.assertIn(self.error_msg, rendered_html) - self.assertIn(self.valid_xml, rendered_html) + self.assertIn(str(descriptor), rendered_html) class TestNonStaffErrorModule(TestErrorModule): @@ -76,4 +76,4 @@ class TestNonStaffErrorModule(TestErrorModule): module = error_descriptor.xmodule(self.system) rendered_html = module.get_html() self.assertNotIn(self.error_msg, rendered_html) - self.assertNotIn(self.valid_xml, rendered_html) + self.assertNotIn(str(descriptor), rendered_html)