Commit acff071e authored by Sebastien Robin's avatar Sebastien Robin

check if the category already exists

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13425 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b8417f2c
...@@ -329,11 +329,12 @@ class TestImmobilisationMixin(TestOrderMixin, ERP5TypeTestCase): ...@@ -329,11 +329,12 @@ class TestImmobilisationMixin(TestOrderMixin, ERP5TypeTestCase):
Create a category tree Create a category tree
""" """
for category, codification, vault_type, new_tree in category_tree: for category, codification, vault_type, new_tree in category_tree:
new_category = current_category.newContent(portal_type='Category', if category not in current_category.objectIds():
id=category, new_category = current_category.newContent(portal_type='Category',
codification=codification) id=category,
new_category.setVaultType(vault_type) codification=codification)
self.createCategorySiteTree(new_category, new_tree) new_category.setVaultType(vault_type)
self.createCategorySiteTree(new_category, new_tree)
def createCurrency(self): def createCurrency(self):
currency_module = self.getCurrencyModule() currency_module = self.getCurrencyModule()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment