Commit b3f92b07 authored by Jérome Perrin's avatar Jérome Perrin

check if category already exists before creating it (usefull for some --load)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24437 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent aafb5935
...@@ -113,8 +113,10 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -113,8 +113,10 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
if prefix is None: if prefix is None:
prefix = '' prefix = ''
gender = self.getPortal().portal_categories['gender'] gender = self.getPortal().portal_categories['gender']
gender.newContent(id='male', title='Male', portal_type='Category') if 'male' not in gender.objectIds():
gender.newContent(id='female', title='Female', portal_type='Category') gender.newContent(id='male', title='Male', portal_type='Category')
if 'female' not in gender.objectIds():
gender.newContent(id='female', title='Female', portal_type='Category')
bar = self.bar_module.newContent(id='bar', bar = self.bar_module.newContent(id='bar',
portal_type='Bar', portal_type='Bar',
......
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