Commit 093bffae authored by Vincent Pelletier's avatar Vincent Pelletier

Add the possibility to create site categories at any depth, creating...

Add the possibility to create site categories at any depth, creating intermediate categories as needed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28237 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 321746c7
......@@ -549,6 +549,13 @@ class TestERP5BankingMixin:
if len(site_list) != 0:
for site in site_list:
if isinstance(site, tuple):
container = self.site_base_category
if len(site) == 3:
for category_id in site[2].split('/'):
contained = getattr(container, category_id, None)
if contained is None:
contained = container.newContent(id=cateogry_id, portal_type='Category')
container = contained
codification = site[1]
site = site[0]
if site == "paris":
......@@ -561,7 +568,7 @@ class TestERP5BankingMixin:
self.siege = self.site_base_category.newContent(id='siege', portal_type='Category', codification='HQ1', vault_type='site')
created_site_list.append(self.siege)
else:
site = self.site_base_category.newContent(id=site, portal_type='Category', codification=codification, vault_type='site')
site = container.newContent(id=site, portal_type='Category', codification=codification, vault_type='site')
created_site_list.append(site)
self.vault_type_base_category = getattr(self.category_tool, 'vault_type')
......
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