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 _create_random_obj(self, is_add_rest_attrs): """Create Issue entity with randomly and predictably filled fields, if 'is_add_rest_attrs' then add attributes for REST.""" issue_obj = self.obj_inst().update_attrs( title=self.obj_title, status=unicode(object_states.DRAFT), due_date=date_utils.first_working_day_after_today()) if is_add_rest_attrs: issue_obj.update_attrs( recipients=",".join((unicode(roles.ADMIN), unicode(roles.PRIMARY_CONTACTS), unicode(roles.SECONDARY_CONTACTS)))) return issue_obj
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 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