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
Beispiel #2
0
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
Beispiel #3
0
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
Beispiel #4
0
 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
Beispiel #5
0
def create_workflow(**attrs):
  """Creates Workflow via REST."""
  workflow = workflow_entity_factory.WorkflowFactory().create(**attrs)
  return workflow_rest_service.WorkflowRestService().create(workflow)