diff --git a/test/test.py b/test/test.py index d76a34e..9fe35d6 100644 --- a/test/test.py +++ b/test/test.py @@ -220,6 +220,13 @@ class FormDefinitionTest(unittest.TestCase): self.assertNotIn('val_checkbox', errors) self.assertEquals(values['val_checkbox'], 'on') + def testValidateCheckboxDefaultOn(self): + fd = self.fc.get_form_def('test_val_checkbox_on') + form_values = {"val_checkbox_on": 'off'} + errors, values = fd.validate(form_values) + self.assertNotIn('val_checkbox_on', errors) + self.assertEquals(values['val_checkbox_on'], 'off') + def testValidateCheckboxInvalid(self): fd = self.fc.get_form_def('test_val_checkbox') form_values = {"val_checkbox": 'true'} diff --git a/test/test_formdefinition_validate.json b/test/test_formdefinition_validate.json index 5cbd0bd..043516f 100644 --- a/test/test_formdefinition_validate.json +++ b/test/test_formdefinition_validate.json @@ -98,6 +98,20 @@ } ] }, + { + "name": "test_val_checkbox_on", + "title": "test_val_checkbox_on", + "description": "description", + "script": "test.sh", + "fields": [ + { + "name": "val_checkbox", + "title": "field", + "type": "checkbox", + "value": true + } + ] + }, { "name": "test_val_text", "title": "title",