Commit 7802366d authored by Fabien Morin's avatar Fabien Morin

before installing all bt, check if all needed bt paths are present on the file

system. This change permit to not waste time in case of missing bt (you don't
have to wait for all previous bt to be installed to get the error message) and
the time cost of this operation is negligible (less than 0.007 seconds for 52
bt on my 2 cores 2Gb Ram machine)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29731 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 15659d56
...@@ -748,6 +748,18 @@ class ERP5TypeTestCase(PortalTestCase): ...@@ -748,6 +748,18 @@ class ERP5TypeTestCase(PortalTestCase):
update_business_templates = os.environ.get('update_business_templates') is not None update_business_templates = os.environ.get('update_business_templates') is not None
BusinessTemplate_getModifiedObject = aq_base(getattr(portal, 'BusinessTemplate_getModifiedObject', None)) BusinessTemplate_getModifiedObject = aq_base(getattr(portal, 'BusinessTemplate_getModifiedObject', None))
# check that all bt5 exists, this permit to save time in case of
# missing bt
missing_bt_list = []
from DateTime import DateTime
for url, bt_title in business_template_list:
# if the bt is not found, an error is raised
if not portal.portal_templates.assertBtPathExists(url):
missing_bt_list.append(bt_title)
if len(missing_bt_list):
raise "Some bt can't be found on your system : %r" % \
missing_bt_list
# Add some business templates # Add some business templates
for url, bt_title in business_template_list: for url, bt_title in business_template_list:
start = time.time() start = time.time()
......
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