3
0
Fork 0

fix: improve handling of boolean form fields

This commit is contained in:
Lance Edgar 2024-08-23 20:38:46 -05:00
parent 2503836ef5
commit 43ad0ae1c1
5 changed files with 27 additions and 3 deletions

View file

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