fix: improve handling of boolean form fields
This commit is contained in:
parent
2503836ef5
commit
43ad0ae1c1
5 changed files with 27 additions and 3 deletions
|
@ -520,6 +520,16 @@ class TestForm(TestCase):
|
|||
data = form.get_vue_model_data()
|
||||
self.assertEqual(len(data), 2)
|
||||
|
||||
# confirm bool values make it thru as-is
|
||||
schema.add(colander.SchemaNode(colander.Bool(), name='baz'))
|
||||
form = self.make_form(schema=schema, model_instance={
|
||||
'foo': 'one',
|
||||
'bar': 'two',
|
||||
'baz': True,
|
||||
})
|
||||
data = form.get_vue_model_data()
|
||||
self.assertEqual(list(data.values()), ['one', 'two', True])
|
||||
|
||||
def test_get_field_errors(self):
|
||||
schema = self.make_schema()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue