Commit d895c64f by Diana Huang

Use full descriptor when showing errors, not just the model data.

parent f3b36b8b
...@@ -121,7 +121,7 @@ class ErrorDescriptor(ErrorFields, JSONEditingDescriptor): ...@@ -121,7 +121,7 @@ class ErrorDescriptor(ErrorFields, JSONEditingDescriptor):
def from_descriptor(cls, descriptor, error_msg='Error not available'): def from_descriptor(cls, descriptor, error_msg='Error not available'):
return cls._construct( return cls._construct(
descriptor.system, descriptor.system,
descriptor._model_data, str(descriptor),
error_msg, error_msg,
location=descriptor.location, location=descriptor.location,
) )
......
...@@ -43,7 +43,7 @@ class TestErrorModule(unittest.TestCase): ...@@ -43,7 +43,7 @@ class TestErrorModule(unittest.TestCase):
module = error_descriptor.xmodule(self.system) module = error_descriptor.xmodule(self.system)
rendered_html = module.get_html() rendered_html = module.get_html()
self.assertIn(self.error_msg, rendered_html) self.assertIn(self.error_msg, rendered_html)
self.assertIn(self.valid_xml, rendered_html) self.assertIn(str(descriptor), rendered_html)
class TestNonStaffErrorModule(TestErrorModule): class TestNonStaffErrorModule(TestErrorModule):
...@@ -76,4 +76,4 @@ class TestNonStaffErrorModule(TestErrorModule): ...@@ -76,4 +76,4 @@ class TestNonStaffErrorModule(TestErrorModule):
module = error_descriptor.xmodule(self.system) module = error_descriptor.xmodule(self.system)
rendered_html = module.get_html() rendered_html = module.get_html()
self.assertNotIn(self.error_msg, rendered_html) self.assertNotIn(self.error_msg, rendered_html)
self.assertNotIn(self.valid_xml, rendered_html) self.assertNotIn(str(descriptor), rendered_html)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment