cr-connect-workflow/tests/workflow/test_workflow_delete_variables.py

20 lines
767 B
Python
Raw Normal View History

2022-02-21 12:55:33 -05:00
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
items = ('a_item', 'b_item', 'c_item', 'd_item', 'e_item')
2022-02-21 14:01:35 -05:00
for item in items:
2022-02-21 12:55:33 -05:00
self.assertIn(item, task.data)
workflow_api = self.complete_form(workflow, task, {})
task = workflow_api.next_task
2022-02-21 14:01:35 -05:00
for item in items:
2022-02-21 12:55:33 -05:00
self.assertNotIn(item, task.data)