Commit ce80ff25 authored by Julien Muchembled's avatar Julien Muchembled

tests: automatically add erp5_core_proxy_field_legacy & erp5_stock_cache iff required

parent 80edfe2c
...@@ -808,16 +808,15 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin): ...@@ -808,16 +808,15 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
BaseMessage.max_retry = property(lambda self: BaseMessage.max_retry = property(lambda self:
self.activity_kw.get('max_retry', 1)) self.activity_kw.get('max_retry', 1))
template_list = self.getBusinessTemplateList() template_list = list(self.getBusinessTemplateList())
erp5_catalog_storage = os.environ.get('erp5_catalog_storage', erp5_catalog_storage = os.environ.get('erp5_catalog_storage',
'erp5_mysql_innodb_catalog') 'erp5_mysql_innodb_catalog')
update_business_templates = os.environ.get('update_business_templates') is not None update_business_templates = os.environ.get('update_business_templates') is not None
erp5_load_data_fs = int(os.environ.get('erp5_load_data_fs', 0)) erp5_load_data_fs = int(os.environ.get('erp5_load_data_fs', 0))
if update_business_templates and erp5_load_data_fs: if update_business_templates and erp5_load_data_fs:
update_only = os.environ.get('update_only', None) update_only = os.environ.get('update_only', None)
template_list = (erp5_catalog_storage, 'erp5_property_sheets', template_list[:0] = (erp5_catalog_storage, 'erp5_property_sheets',
'erp5_core', 'erp5_xhtml_style') \ 'erp5_core', 'erp5_xhtml_style')
+ tuple(template_list)
# Update only specified business templates, regular expression # Update only specified business templates, regular expression
# can be used. # can be used.
if update_only is not None: if update_only is not None:
...@@ -836,10 +835,13 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin): ...@@ -836,10 +835,13 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
light_install = self.enableLightInstall() light_install = self.enableLightInstall()
create_activities = self.enableActivityTool() create_activities = self.enableActivityTool()
hot_reindexing = self.enableHotReindexing() hot_reindexing = self.enableHotReindexing()
# We want to always have optimisation available for x, y in (("erp5_core_proxy_field_legacy", "erp5_base"),
if "erp5_stock_cache" not in template_list: ("erp5_stock_cache", "erp5_pdm")):
template_list = list(template_list) if x not in template_list:
template_list.append("erp5_stock_cache") try:
template_list.insert(template_list.index(y), x)
except ValueError:
pass
self.setUpERP5Site(business_template_list=template_list, self.setUpERP5Site(business_template_list=template_list,
light_install=light_install, light_install=light_install,
create_activities=create_activities, create_activities=create_activities,
......
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