Commit 349a74b1 authored by Julien Muchembled's avatar Julien Muchembled

ERP5TypeTestCase: fix condition to run some code only once

This fixes unwanted calls to _setUpDummyMailHost

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42952 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5887d1e7
......@@ -228,7 +228,7 @@ failed_portal_installation = {}
# have we installed business templates ?
# this is a mapping 'list of business template -> boolean
setup_done = {}
setup_done = set()
def _getConnectionStringDict():
"""Returns the connection strings used for this test.
......@@ -930,9 +930,9 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
app.test_portal_name = portal_name
global setup_done
portal = app._getOb(portal_name, None)
if portal is None or not setup_done.get(tuple(business_template_list)):
setup_done[tuple(business_template_list)] = 1
setup_key = (portal_name,) + tuple(business_template_list)
if setup_key not in setup_done:
setup_done.add(setup_key)
business_template_list = \
self._getBTPathAndIdList(business_template_list)
try:
......@@ -951,7 +951,7 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
setattr(app, 'isIndexable', 0)
reindex = 0
if portal is None:
if app._getOb(portal_name, None) is None:
if not quiet:
ZopeTestCase._print('Adding %s ERP5 Site ... ' % portal_name)
......
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