def test_create_repeate_on_workflow(self, login_as_creator_or_reader, selenium): """Test creation repeat on workflow.""" workflow = workflow_entity_factory.WorkflowFactory().create( repeat_every=1, repeat_unit=workflow_repeat_units.WEEKDAY) workflow_entity_factory.TaskGroupFactory().create(workflow=workflow) workflow_ui_facade.create_workflow(workflow) actual_workflow = ui_facade.get_obj(workflow) object_rest_facade.set_attrs_via_get(workflow, ["created_at"]) object_rest_facade.set_attrs_via_get(workflow, ["updated_at"]) test_utils.obj_assert(actual_workflow, workflow)
def workflow_ui_to_app(ui_dict): """Converts Workflow ui_dict to app_entity.""" return workflow_entity_factory.WorkflowFactory().create_empty( obj_id=int(ui_dict["obj_id"]), title=ui_dict["title"], state=ui_dict["state"], is_archived=ui_dict["is_archived"], admins=emails_to_app_people(ui_dict["admins"]), wf_members=emails_to_app_people(ui_dict["workflow_members"]), created_at=date_utils.ui_str_with_zone_to_datetime( ui_dict["created_at"]), updated_at=date_utils.ui_str_with_zone_to_datetime( ui_dict["updated_at"]), modified_by=email_to_app_person(ui_dict["modified_by"]), task_groups=[], code=ui_dict["code"])
def create_workflow(**attrs): """Creates Workflow via REST.""" workflow = workflow_entity_factory.WorkflowFactory().create(**attrs) return workflow_rest_service.WorkflowRestService().create(workflow)
def workflow(self): """Create workflow via UI.""" workflow = workflow_entity_factory.WorkflowFactory().create() workflow_entity_factory.TaskGroupFactory().create(workflow=workflow) workflow_ui_facade.create_workflow(workflow) return workflow