From c7326735aad08bdb1dd60798d6afb44a3ff8a72a Mon Sep 17 00:00:00 2001 From: Sebastien Robin <seb@nexedi.com> Date: Mon, 12 Mar 2007 21:55:10 +0000 Subject: [PATCH] the type of the line portal type was not well defined git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13385 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/tests/testImmobilisation.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/product/ERP5/tests/testImmobilisation.py b/product/ERP5/tests/testImmobilisation.py index 8f4c426417..1d29e769b9 100644 --- a/product/ERP5/tests/testImmobilisation.py +++ b/product/ERP5/tests/testImmobilisation.py @@ -64,6 +64,7 @@ class TestImmobilisationMixin(TestOrderMixin, ERP5TypeTestCase): # Different variables used for this test item_portal_type = 'Apparel Fabric Item' packing_list_portal_type = 'Purchase Packing List' + packing_list_line_portal_type = 'Purchase Packing List Line' internal_packing_list_portal_type = 'Internal Packing List' sale_packing_list_portal_type = 'Sale Packing List' inventory_portal_type = 'Inventory' @@ -133,7 +134,8 @@ class TestImmobilisationMixin(TestOrderMixin, ERP5TypeTestCase): This user will be used to initialize data in the method afterSetup """ all_roles = ['Manager','Assignor','Assignee','Author','Associate','Auditor'] - self.getUserFolder()._doAddUser('manager', '', all_roles, []) + if not "manager" in [x.id for x in self.getUserFolder().objectValues()]: + self.getUserFolder()._doAddUser('manager', '', all_roles, []) self.login('manager') self.assignPASRolesToUser('test_user_1_', all_roles) @@ -320,8 +322,9 @@ class TestImmobilisationMixin(TestOrderMixin, ERP5TypeTestCase): Create a category tree """ for category, codification, new_tree in category_tree: - new_category = current_category.newContent(portal_type='Category', id=category, codification=codification) - self.createCategoryTree(new_category, new_tree) + if category not in current_category.objectIds(): + new_category = current_category.newContent(portal_type='Category', id=category, codification=codification) + self.createCategoryTree(new_category, new_tree) def createCategorySiteTree(self, current_category, category_tree): """ -- 2.30.9