def setUp(self): super(DecomposerTestCase, self).setUp() self.document = Document3DController.create('doc1', 'Document3D', 'a', self.user, self.DATA) self.controller.attach_to_document(self.document) f=open("apps/document3D/data_test/test.stp") myfile = File(f) myfile.name="test.stp" self.stp=self.document.add_file(myfile) self.ctrl2 = Document3DController.create('doc2', 'Document3D', 'a', self.user, self.DATA)
def setUp(self): super(DecomposerTestCase, self).setUp() self.document = Document3DController.create('doc1', 'Document3D', 'a', self.user, self.DATA) self.controller.attach_to_document(self.document) f = open("apps/document3D/data_test/test.stp") myfile = File(f) myfile.name = "test.stp" self.stp = self.document.add_file(myfile) self.ctrl2 = Document3DController.create('doc2', 'Document3D', 'a', self.user, self.DATA)
def setUp(self): super(arborescense_Test, self).setUp() self.document = Document3DController.create('doc1', 'Document3D', 'a', self.user, self.DATA) f = open("apps/document3D/data_test/test.stp") myfile = File(f) self.stp = self.document.add_file(myfile) self.controller.attach_to_document(self.document.object) self.data_to_decompose = self.update_data(self.stp)
def setUp(self): super(arborescense_Test, self).setUp() self.document = Document3DController.create('doc1', 'Document3D', 'a', self.user, self.DATA) f=open("apps/document3D/data_test/test.stp") myfile = File(f) self.stp=self.document.add_file(myfile) self.controller.attach_to_document(self.document.object) self.data_to_decompose = self.update_data(self.stp)
def test_get_product(self): #We verify if the structure of the tree is the same for a file without decompose and the new file generated once decomposed product = self.document.get_product(self.stp) self.post(self.base_url + "decompose/" + str(self.stp.id) + "/", self.data_to_decompose) ctrl = Document3DController( Document3D.objects.get(id=self.document.id), self.user) product2 = ctrl.get_product(ctrl.files[0], True) self.assertTrue(same_structure(product, product2))
def setUp(self): super(view_3dTest, self).setUp() self.document = Document3DController.create('doc1', 'Document3D', 'a', self.user, self.DATA)