示例#1
0
    def setUp(self):
        self.url = '/api/bulk/update'
        
        setProjectSimple(project='default')
        
        self.client = Client()

        self.attr_schema  = AS.objects.create(name='Root', description = '', id=nc_id.get(), parent=None)
        
        self.attr_type    = Type.objects.create(name='Text', id=nc_id.get())
        self.attr_type2   = Type.objects.create(name='Memo', id=nc_id.get())
        
        self.object_type1 = OT.objects.create(name='OT1', id=nc_id.get(), description = '', parent=None)
        self.object_type2 = OT.objects.create(name='OT2', id=nc_id.get(), description = '', parent=self.object_type1)

        self.attr_group1  = AG.objects.create(name='DiGi1', id=nc_id.get(), schema=self.attr_schema)
        self.attr_group2  = AG.objects.create(name='DiGi2', id=nc_id.get(), schema=self.attr_schema)

        self.attr1        = ATTR.objects.create(name='Attr1', id=nc_id.get(), type=self.attr_type, group=self.attr_group1, schema=self.attr_schema)
        self.attr2        = ATTR.objects.create(name='Attr2', id=nc_id.get(), type=self.attr_type, group=self.attr_group2, schema=self.attr_schema)
        
        self.aot1         = AOT.create(attr=self.attr1, options=0, object_type=self.object_type1, schema=self.attr_schema)
        self.aot1         = AOT.create(attr=self.attr2, options=0, object_type=self.object_type2, schema=self.attr_schema)
        
        #Bulk edit
        self.be_object_type1 = Tree_bulk_edit.objects.create(name=self.object_type1.name, orig_id=self.object_type1.id, parent=None,                 type='object_type', attr_schema=self.attr_schema)
        self.be_object_type2 = Tree_bulk_edit.objects.create(name=self.object_type2.name, orig_id=self.object_type2.id, parent=self.be_object_type1, type='object_type', attr_schema=self.attr_schema)

        self.be_attr_group1  = Tree_bulk_edit.objects.create(name=self.attr_group1.name,  orig_id=self.attr_group1.id, parent=self.be_object_type1, type='attr_group', attr_schema=self.attr_schema)
        self.be_attr_group2  = Tree_bulk_edit.objects.create(name=self.attr_group2.name,  orig_id=self.attr_group2.id, parent=self.be_object_type2, type='attr_group', attr_schema=self.attr_schema)

        self.be_attr1        = Tree_bulk_edit.objects.create(name=self.attr1.name, orig_id=self.attr1.id, parent=self.be_attr_group1, type='attr', attr_schema=self.attr_schema)
        self.be_attr2        = Tree_bulk_edit.objects.create(name=self.attr2.name, orig_id=self.attr2.id, parent=self.be_attr_group2, type='attr', attr_schema=self.attr_schema)
示例#2
0
    def setUp(self):       
        self.url = '/api/analytic'
        
        setProjectSimple(project='default')
        
        self.client       = Client()
        
        self.attr_schema  = AS.objects.create(name='Root', id=nc_id.get(), parent=None)
        
        self.attr_type    = Type.objects.create(name='Text', id=nc_id.get())
        
        self.object_type1 = OT.objects.create(name='OT1',  id=nc_id.get(), parent=None)
        self.object_type2 = OT.objects.create(name='OT2',  id=nc_id.get(), parent=self.object_type1)
        self.object_type3 = OT.objects.create(name='OT3',  id=nc_id.get(), parent=self.object_type2)

        self.attr_group1  = AG.objects.create(name='DiGi1', id=nc_id.get(), schema=self.attr_schema)
        self.attr_group2  = AG.objects.create(name='DiGi2', id=nc_id.get(), schema=self.attr_schema)
        self.attr_group3  = AG.objects.create(name='DiGi3', id=nc_id.get(), schema=self.attr_schema)

        self.attr1        = ATTR.objects.create(name='Attr1', id=nc_id.get(), type=self.attr_type, group=self.attr_group1, schema=self.attr_schema)
        self.attr2        = ATTR.objects.create(name='Attr2', id=nc_id.get(), type=self.attr_type, group=self.attr_group2, schema=self.attr_schema)
        self.attr3        = ATTR.objects.create(name='Attr3', id=nc_id.get(), type=self.attr_type, group=self.attr_group3, schema=self.attr_schema)

        self.aot1_exist   = AOT.create(attr=self.attr1, options=0, object_type=self.object_type1, schema=self.attr_schema, id=nc_id.get())
        self.aot2_exist   = AOT.create(attr=self.attr2, options=0, object_type=self.object_type2, schema=self.attr_schema, id=nc_id.get())
        self.aot3_exist   = AOT.create(attr=self.attr3, options=0, object_type=self.object_type3, schema=self.attr_schema, id=nc_id.get())
示例#3
0
 def setUp(self):
     self.url = '/api/aot/rebind'
             
     setProjectSimple(project='default')
     
     self.client = Client()
     
     self.attr_schema  = AS.objects.create(name='Root', id=nc_id.get(), parent_id=None)
     
     self.attr_type    = Type.objects.create(name='Text', id=nc_id.get())
     self.attr_type2   = Type.objects.create(name='Memo', id=nc_id.get())
     
     self.object_type1 = OT.objects.create(name='OT1', id=nc_id.get(), parent=None)
     self.object_type2 = OT.objects.create(name='OT2', id=nc_id.get(), parent=self.object_type1)
     
     self.attr_group1  = AG.objects.create(name='DiGi1', id=nc_id.get(), schema=self.attr_schema)
     self.attr_group2  = AG.objects.create(name='DiGi2', id=nc_id.get(), schema=self.attr_schema)
     
     self.attr1        = ATTR.objects.create(name='Attr1', id=nc_id.get(), type=self.attr_type, group=self.attr_group1, schema=self.attr_schema)
     self.attr2        = ATTR.objects.create(name='Attr2', id=nc_id.get(), type=self.attr_type, group=self.attr_group2, schema=self.attr_schema)
     self.attr3        = ATTR.objects.create(name='Attr3', id=nc_id.get(), type=self.attr_type, group=self.attr_group2, schema=self.attr_schema)
     
     self.aot1         = AOT.create(attr=self.attr1, options=0, object_type=self.object_type1, schema=self.attr_schema)
     self.aot2         = AOT.create(attr=self.attr2, options=0, object_type=self.object_type2, schema=self.attr_schema)
     
     self.aot_unbind   = AOT.create(attr=self.attr3, options=2, object_type=self.object_type2, schema=self.attr_schema)
示例#4
0
    def setUp(self):
        self.url = "/api/bulk/index"

        setProjectSimple(project="default")

        self.client = Client()

        self.attr_schema = AS.objects.create(name="Root", description="", id=nc_id.get(), parent=None)

        self.attr_type = Type.objects.create(name="Text", id=nc_id.get())
        self.attr_type2 = Type.objects.create(name="Memo", id=nc_id.get())

        self.object_type1 = OT.objects.create(name="OT1", id=nc_id.get(), description="", parent=None)
        self.object_type2 = OT.objects.create(name="OT2", id=nc_id.get(), description="", parent=self.object_type1)

        self.attr_group1 = AG.objects.create(name="DiGi1", id=nc_id.get(), schema=self.attr_schema)
        self.attr_group2 = AG.objects.create(name="DiGi2", id=nc_id.get(), schema=self.attr_schema)

        self.attr1 = ATTR.objects.create(
            name="Attr1", id=nc_id.get(), type=self.attr_type, group=self.attr_group1, schema=self.attr_schema
        )
        self.attr2 = ATTR.objects.create(
            name="Attr2", id=nc_id.get(), type=self.attr_type, group=self.attr_group2, schema=self.attr_schema
        )

        self.aot1 = AOT.create(attr=self.attr1, options=0, object_type=self.object_type1, schema=self.attr_schema)
        self.aot1 = AOT.create(attr=self.attr2, options=0, object_type=self.object_type2, schema=self.attr_schema)

        # Bulk edit
        self.be_object_type1 = Tree_bulk_edit.objects.create(
            name=self.object_type1.name,
            orig_id=self.object_type1.id,
            parent=None,
            type="object_type",
            attr_schema=self.attr_schema,
        )
        self.be_object_type2 = Tree_bulk_edit.objects.create(
            name=self.object_type2.name,
            orig_id=self.object_type2.id,
            parent=self.be_object_type1,
            type="object_type",
            attr_schema=self.attr_schema,
        )

        self.be_attr_group1 = Tree_bulk_edit.objects.create(
            name=self.attr_group1.name,
            orig_id=self.attr_group1.id,
            parent=self.be_object_type1,
            type="attr_group",
            attr_schema=self.attr_schema,
        )
        self.be_attr_group2 = Tree_bulk_edit.objects.create(
            name=self.attr_group2.name,
            orig_id=self.attr_group2.id,
            parent=self.be_object_type2,
            type="attr_group",
            attr_schema=self.attr_schema,
        )

        self.be_attr1 = Tree_bulk_edit.objects.create(
            name=self.attr1.name,
            orig_id=self.attr1.id,
            parent=self.be_attr_group1,
            type="attr",
            attr_schema=self.attr_schema,
        )
        self.be_attr2 = Tree_bulk_edit.objects.create(
            name=self.attr2.name,
            orig_id=self.attr2.id,
            parent=self.be_attr_group2,
            type="attr",
            attr_schema=self.attr_schema,
        )