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

This commit is contained in:
Diana Huang
2013-06-04 10:43:06 -04:00
parent f3b36b8bc9
commit d895c64f4a
2 changed files with 3 additions and 3 deletions

View File

@@ -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,
)

View File

@@ -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)