Commit 2b529ad8 authored by Fabien Morin's avatar Fabien Morin

add preferences required by some portal_types


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29432 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fa7ceae4
......@@ -31,6 +31,7 @@ import transaction
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager
from Products.CMFCore.utils import getToolByName
from zLOG import LOG
from Products.ERP5Type.tests.Sequence import SequenceList
from DateTime import DateTime
......@@ -73,11 +74,32 @@ class TestResource(ERP5TypeTestCase):
user = uf.getUserById('rc').__of__(uf)
newSecurityManager(None, user)
def setUpPreferences(self):
portal = self.getPortal()
preferences = getToolByName(portal,'portal_preferences')
system_preference = preferences.newContent(
portal_type = 'System Preference'
)
system_preference.edit(
preferred_apparel_model_variation_base_category_list = ('colour', 'size', 'morphology', 'industrial_phase',),
preferred_apparel_cloth_variation_base_category_list = ('size',),
preferred_apparel_component_variation_base_category_list = ('variation',),
preferred_apparel_colour_variation_base_category_list = ('colour',),
priority = 1,
)
system_preference.enable()
transaction.commit()
self.tic()
def afterSetUp(self):
self.login()
self.portal = self.getPortal()
self.category_tool = self.getCategoryTool()
self.createCategories()
self.setUpPreferences()
def beforeTearDown(self):
transaction.abort()
......
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