diff --git a/tests/data/delete_variables/delete_variables.bpmn b/tests/data/delete_variables/delete_variables.bpmn new file mode 100644 index 00000000..ef7ccc65 --- /dev/null +++ b/tests/data/delete_variables/delete_variables.bpmn @@ -0,0 +1,84 @@ + + + + + Flow_0zdl9n2 + + + + + + Flow_0aftk6v + + + + Flow_0zdl9n2 + Flow_14niiph + a = 1 +b = 2 +c = 'a string' +d = a + b +e = datetime.datetime.now() + + + Flow_0ke44z0 + Flow_1wjlzq0 + delete_variables('a', 'b', 'c', 'd', 'e') + + + ## Task Data +{{ task_data }} + Flow_1wjlzq0 + Flow_0aftk6v + + + + ## Task Data +{{ task_data }} + Flow_14niiph + Flow_0ke44z0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/workflow/test_workflow_delete_variables.py b/tests/workflow/test_workflow_delete_variables.py new file mode 100644 index 00000000..750e0f15 --- /dev/null +++ b/tests/workflow/test_workflow_delete_variables.py @@ -0,0 +1,18 @@ +from tests.base_test import BaseTest + + +class TestDeleteVariables(BaseTest): + + def test_delete_variables(self): + """This workflow creates variables 'a', 'b', 'c', 'd', and 'e', + then deletes them with the delete_variables script. + We assert that they are no longer in task.data""" + workflow = self.create_workflow('delete_variables') + workflow_api = self.get_workflow_api(workflow) + task = workflow_api.next_task + for item in ('a', 'b', 'c', 'd', 'e'): + self.assertIn(item, task.data) + workflow_api = self.complete_form(workflow, task, {}) + task = workflow_api.next_task + for item in ('a', 'b', 'c', 'd', 'e'): + self.assertNotIn(item, task.data)