diff --git a/tests/data/unchecked_boolean_checkbox/unchecked_boolean_checkbox.bpmn b/tests/data/unchecked_boolean_checkbox/unchecked_boolean_checkbox.bpmn new file mode 100644 index 00000000..1bcaee8e --- /dev/null +++ b/tests/data/unchecked_boolean_checkbox/unchecked_boolean_checkbox.bpmn @@ -0,0 +1,77 @@ + + + + + Flow_1b7cexb + + + + + + + + + + + + + Flow_1b7cexb + Flow_1lbtmyk + + + + ## Var A +{{ var_a }} + Flow_1xgmz1p + Flow_0k6g212 + + + Flow_0k6g212 + + + + Flow_1lbtmyk + Flow_1xgmz1p + # print(var_a) +# if var_a not in (True, False): +# failing_script() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/test_unchecked_checkbox_default.py b/tests/test_unchecked_checkbox_default.py new file mode 100644 index 00000000..5935ca5a --- /dev/null +++ b/tests/test_unchecked_checkbox_default.py @@ -0,0 +1,15 @@ +from tests.base_test import BaseTest +from crc.services.workflow_service import WorkflowService + + +class TestUncheckedCheckboxDefault(BaseTest): + """We want to make sure that we don't get null/None back from a boolean checkbox. + This really requires a test on the frontend, + since there's no way in validation to leave a checkbox unchecked""" + + def test_checkbox_not_null(self): + spec_model = self.load_test_spec('unchecked_boolean_checkbox') + result = WorkflowService.test_spec(spec_model.id) + + self.assertIn('var_a', result) + self.assertIn(result['var_a'], [True, False])