Exemplo n.º 1
0
 def setUp(self):
     self.name = "test"
     self.task_template_name = "task_template_name"
     self.creator = "tester"
     self.extra_info = {"extra_info": "val"}
     self.pipeline_tree = {
         "constants": {
             "key_1": {"value": "val_1", "show_type": "show"},
             "key_2": {"value": "val_2", "show_type": "hide"},
         },
         "activities": {},
         "start_event": {
             "id": "id1",
             "name": "",
             "type": "EmptyStartEvent",
             "incoming": None,
             "outgoing": "flow_id1",
         },
         "end_event": {"id": "id2", "name": "", "type": "EmptyEndEvent", "incoming": "flow_id1", "outgoing": None},
         "gateways": {},
         "flows": {"flow_id1": {"id": "flow_id1", "source": "id1", "target": "id2"}},
     }
     self.project = Project.objects.create(name="test_project", time_zone="Asia/Shanghai", creator="test", desc="")
     self.invalid_project = Project.objects.create(
         name="invalid_project", time_zone="Asia/Shanghai", creator="test", desc=""
     )
     self.snapshot = Snapshot.objects.create_snapshot({})
     self.pipeline_template = PipelineTemplate.objects.create(
         template_id=uniqid(), name=self.task_template_name, creator=self.creator, snapshot=self.snapshot
     )
     task_template = TaskTemplate(project=self.project, pipeline_template=self.pipeline_template,)
     task_template.save()
     self.template = task_template
     self.task = self.create_a_task()
Exemplo n.º 2
0
 def setUp(self):
     self.name = 'test'
     self.creator = 'tester'
     self.extra_info = {'extra_info': 'val'}
     self.pipeline_tree = {
         'constants': {
             'key_1': {
                 'value': 'val_1',
                 'show_type': 'show',
             },
             'key_2': {
                 'value': 'val_2',
                 'show_type': 'hide',
             }
         }
     }
     self.business = Business.objects.create(
         cc_id=1,
         cc_name='mock business',
         cc_owner='tester',
         cc_company='',
         life_cycle='2',
         executor='',
     )
     self.invalid_business = Business.objects.create(
         cc_id=2,
         cc_name='mock business',
         cc_owner='tester',
         cc_company='',
         life_cycle='2',
         executor='',
     )
     self.snapshot, _ = Snapshot.objects.create_or_get_snapshot({})
     self.pipeline_template = PipelineTemplate.objects.create(
         template_id=uniqid(),
         name=self.name,
         creator=self.creator,
         snapshot=self.snapshot)
     task_template = TaskTemplate(
         business=self.business,
         pipeline_template=self.pipeline_template,
     )
     task_template.save()
     self.template = task_template
     self.task = self.create_a_task()
Exemplo n.º 3
0
 def setUp(self):
     self.name = 'test'
     self.task_template_name = 'task_template_name'
     self.creator = 'tester'
     self.extra_info = {'extra_info': 'val'}
     self.pipeline_tree = {
         'constants': {
             'key_1': {
                 'value': 'val_1',
                 'show_type': 'show',
             },
             'key_2': {
                 'value': 'val_2',
                 'show_type': 'hide',
             }
         }
     }
     self.project = Project.objects.create(name='test_project',
                                           time_zone='Asia/Shanghai',
                                           creator='test',
                                           desc='')
     self.invalid_project = Project.objects.create(
         name='invalid_project',
         time_zone='Asia/Shanghai',
         creator='test',
         desc='')
     self.snapshot, _ = Snapshot.objects.create_or_get_snapshot({})
     self.pipeline_template = PipelineTemplate.objects.create(
         template_id=uniqid(),
         name=self.task_template_name,
         creator=self.creator,
         snapshot=self.snapshot)
     task_template = TaskTemplate(
         project=self.project,
         pipeline_template=self.pipeline_template,
     )
     task_template.save()
     self.template = task_template
     self.task = self.create_a_task()