Commit d743328d authored by Fabien Morin's avatar Fabien Morin

add preferences required by erp5_apparel bt


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29438 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0c0b3677
...@@ -76,6 +76,26 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -76,6 +76,26 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
""" """
return ('erp5_base', 'erp5_pdm', 'erp5_trade', 'erp5_apparel') return ('erp5_base', 'erp5_pdm', 'erp5_trade', 'erp5_apparel')
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, quiet=1, run=run_all_test): def afterSetUp(self, quiet=1, run=run_all_test):
self.login() self.login()
self.category_tool = self.getCategoryTool() self.category_tool = self.getCategoryTool()
...@@ -88,6 +108,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase): ...@@ -88,6 +108,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
from Products.ERP5Type.Document.PackingList import PackingList from Products.ERP5Type.Document.PackingList import PackingList
PackingList.isPacked = isPacked PackingList.isPacked = isPacked
self.createCurrency() self.createCurrency()
self.setUpPreferences()
def createCategory(self, parent, id_list): def createCategory(self, parent, id_list):
last_category = None last_category = None
......
...@@ -67,6 +67,26 @@ class TestOrderMixin: ...@@ -67,6 +67,26 @@ class TestOrderMixin:
user = uf.getUserById('rc').__of__(uf) user = uf.getUserById('rc').__of__(uf)
newSecurityManager(None, user) 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, quiet=1, run=1): def afterSetUp(self, quiet=1, run=1):
self.login() self.login()
portal = self.getPortal() portal = self.getPortal()
...@@ -75,6 +95,7 @@ class TestOrderMixin: ...@@ -75,6 +95,7 @@ class TestOrderMixin:
#portal_catalog.manage_catalogClear() #portal_catalog.manage_catalogClear()
self.createCategories() self.createCategories()
self.validateRules() self.validateRules()
self.setUpPreferences()
def createCurrency(self): def createCurrency(self):
currency_module = self.getPortal().currency_module currency_module = self.getPortal().currency_module
......
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