From 3bd591b2ce04fdd536e0c86a15dc4c48c972146d Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Tue, 24 May 2022 15:32:51 -0400 Subject: [PATCH] Allow us to set the `admin` bit when creating a test WorkflowSpecCategory This allows us to create an "admin sandbox" category in a test --- tests/base_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/base_test.py b/tests/base_test.py index 27c68c17..718e3952 100644 --- a/tests/base_test.py +++ b/tests/base_test.py @@ -169,12 +169,14 @@ class BaseTest(unittest.TestCase): self.workflow_spec_service.add_category(category) return category - def assure_category_exists(self, category_id=None): + def assure_category_exists(self, category_id=None, display_name="Test Workflows", admin=False): category = None if category_id is not None: category = self.workflow_spec_service.get_category(category_id) if category is None: - category = WorkflowSpecCategory(id="test_category", display_name="Test Workflows", admin=False, display_order=0) + if category_id is None: + category_id = 'test_category' + category = WorkflowSpecCategory(id=category_id, display_name=display_name, admin=admin, display_order=0) self.workflow_spec_service.add_category(category) return category