From 7676e230e58c551d28a5af5a5f83446fa9af0a42 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Thu, 30 Sep 2021 12:10:47 -0400 Subject: [PATCH] Test and bpmn for enum checkbox --- tests/data/enum_checkbox/enum_checkbox.bpmn | 65 +++++++++++++++++++ tests/workflow/test_workflow_enum_checkbox.py | 21 ++++++ 2 files changed, 86 insertions(+) create mode 100644 tests/data/enum_checkbox/enum_checkbox.bpmn create mode 100644 tests/workflow/test_workflow_enum_checkbox.py diff --git a/tests/data/enum_checkbox/enum_checkbox.bpmn b/tests/data/enum_checkbox/enum_checkbox.bpmn new file mode 100644 index 00000000..57fb5b0e --- /dev/null +++ b/tests/data/enum_checkbox/enum_checkbox.bpmn @@ -0,0 +1,65 @@ + + + + + Flow_1ui50vr + + + + + + + + + + + + + + + + + Flow_1ui50vr + Flow_07pr9lr + + + + # Enum data +{{ some_field }} + Flow_07pr9lr + Flow_13oillk + + + Flow_13oillk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/workflow/test_workflow_enum_checkbox.py b/tests/workflow/test_workflow_enum_checkbox.py new file mode 100644 index 00000000..9c76cacb --- /dev/null +++ b/tests/workflow/test_workflow_enum_checkbox.py @@ -0,0 +1,21 @@ +from tests.base_test import BaseTest + + +class TestEnumCheckbox(BaseTest): + + def test_enum_checkbox_validation(self): + spec_model = self.load_test_spec('enum_checkbox') + rv = self.app.get('/v1.0/workflow-specification/%s/validate' % spec_model.id, headers=self.logged_in_headers()) + self.assertEqual([], rv.json) + + def test_enum_checkbox(self): + workflow = self.create_workflow('enum_checkbox') + workflow_api = self.get_workflow_api(workflow) + task = workflow_api.next_task + data_values = [{'value': 'value_1', 'label': 'value_1'}, {'value': 'value_3', 'label': 'value_3'}] + + self.complete_form(workflow, task, {'some_field': data_values}) + workflow_api = self.get_workflow_api(workflow) + task = workflow_api.next_task + + self.assertEqual("# Enum data\n[{'value': 'value_1', 'label': 'value_1'}, {'value': 'value_3', 'label': 'value_3'}]", task.documentation)