[Erp5-report] r13425 - /erp5/trunk/products/ERP5/tests/testImmobilisation.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 15 09:35:20 CET 2007


Author: seb
Date: Thu Mar 15 09:35:17 2007
New Revision: 13425

URL: http://svn.erp5.org?rev=13425&view=rev
Log:
check if the category already exists

Modified:
    erp5/trunk/products/ERP5/tests/testImmobilisation.py

Modified: erp5/trunk/products/ERP5/tests/testImmobilisation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testImmobilisation.py?rev=13425&r1=13424&r2=13425&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testImmobilisation.py (original)
+++ erp5/trunk/products/ERP5/tests/testImmobilisation.py Thu Mar 15 09:35:17 2007
@@ -329,11 +329,12 @@
     Create a category tree
     """
     for category, codification, vault_type, new_tree in category_tree:
-      new_category = current_category.newContent(portal_type='Category',
-                                                 id=category,
-                                                 codification=codification)
-      new_category.setVaultType(vault_type)
-      self.createCategorySiteTree(new_category, new_tree)
+      if category not in current_category.objectIds():
+        new_category = current_category.newContent(portal_type='Category',
+                                                   id=category,
+                                                   codification=codification)
+        new_category.setVaultType(vault_type)
+        self.createCategorySiteTree(new_category, new_tree)
    
   def createCurrency(self):
     currency_module = self.getCurrencyModule()




More information about the Erp5-report mailing list