From d895c64f4ac23fdab00954e125ae43a6aeddf132 Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Tue, 4 Jun 2013 10:43:06 -0400 Subject: [PATCH] Use full descriptor when showing errors, not just the model data. --- common/lib/xmodule/xmodule/error_module.py | 2 +- common/lib/xmodule/xmodule/tests/test_error_module.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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)