fix: raise better error if field widget serialization fails
and log a warning with traceback while we're at it
This commit is contained in:
parent
faae9f1b0a
commit
485c503212
2 changed files with 20 additions and 1 deletions
|
|
@ -587,6 +587,14 @@ class TestForm(WebTestCase):
|
|||
html = form.render_vue_field("foo")
|
||||
self.assertIn("something is wrong", html)
|
||||
|
||||
class BadWidget(deform.widget.Widget):
|
||||
def serialize(self, **kwargs):
|
||||
raise NotImplementedError
|
||||
|
||||
# widget serialization error
|
||||
dform["foo"].widget = BadWidget()
|
||||
self.assertRaises(RuntimeError, form.render_vue_field, "foo")
|
||||
|
||||
# add another field, but not to deform, so it should still
|
||||
# display but with no widget
|
||||
form.fields.append("zanzibar")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue