def test_data(self): """Creates an activated workflow with close due date.""" if not TestActivateWorkflow._data: app_workflow = workflow_rest_facade.create_workflow() task_group = workflow_rest_facade.create_task_group( workflow=app_workflow) assignee = person_rest_facade.create_person_with_role( roles.CREATOR) due_date = date_utils.first_working_day_after_today( datetime.date.today()) workflow_rest_facade.create_task_group_task(task_group=task_group, assignees=[assignee], due_date=due_date) workflow_rest_service.WorkflowRestService().activate(app_workflow) # handle GGRC-6527 only try: emails = daily_emails_ui_facade.get_emails_by_user_names( [users.current_user().name, assignee.name]) except TimeoutError as err: if "digest" in err.message: pytest.xfail("GGRC-6527: Digest is not opened") else: raise err TestActivateWorkflow._data = { "wf": app_workflow, "wf_creator_email": emails[users.current_user().name], "assignee_email": emails[assignee.name] } return TestActivateWorkflow._data
def activated_workflow(app_workflow): """Creates an activated workflow.""" task_group = workflow_rest_facade.create_task_group( workflow=app_workflow) workflow_rest_facade.create_task_group_task(task_group=task_group) workflow_rest_service.WorkflowRestService().activate(app_workflow) return app_workflow
def activated_repeat_on_workflow(app_repeat_on_workflow): """Creates an activated repeat on workflow.""" task_group = workflow_rest_facade.create_task_group( workflow=app_repeat_on_workflow) workflow_rest_facade.create_task_group_task(task_group=task_group) app_utils.workaround_edit_without_non_api_request() workflow_rest_service.WorkflowRestService().activate(app_repeat_on_workflow) return app_repeat_on_workflow
def test_data(self): """Creates an activated workflow with close due date.""" if not TestActivateWorkflow._data: app_workflow = workflow_rest_facade.create_workflow() task_group = workflow_rest_facade.create_task_group( workflow=app_workflow) assignee = person_rest_facade.create_person_with_role( roles.CREATOR) due_date = date_utils.first_working_day_after_today( datetime.date.today()) workflow_rest_facade.create_task_group_task(task_group=task_group, assignees=[assignee], due_date=due_date) workflow_rest_service.WorkflowRestService().activate(app_workflow) emails = daily_emails_ui_facade.get_emails_by_user_names( [users.current_user().name, assignee.name]) TestActivateWorkflow._data = { "wf": app_workflow, "wf_creator_email": emails[users.current_user().name], "assignee_email": emails[assignee.name] } return TestActivateWorkflow._data
def create_workflow(**attrs): """Creates Workflow via REST.""" workflow = workflow_entity_factory.WorkflowFactory().create(**attrs) return workflow_rest_service.WorkflowRestService().create(workflow)