Commit 283f7d8a authored by Jérome Perrin's avatar Jérome Perrin

Unify indentation



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8480 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d5eff119
......@@ -202,13 +202,16 @@ class ERP5TypeTestCase(PortalTestCase):
'''Sets up the fixture. Do not override,
use the hooks instead.
'''
# This is a workaround for the overwriting problem in Testing/__init__.py in Zope.
# So this overwrites them again to revert the changes made by Testing.
# This is a workaround for the overwriting problem in Testing/__init__.py
# in Zope. So this overwrites them again to revert the changes made by
# Testing.
try:
import App.config
except ImportError:
os.environ['INSTANCE_HOME'] = INSTANCE_HOME = os.environ['COPY_OF_INSTANCE_HOME']
os.environ['SOFTWARE_HOME'] = SOFTWARE_HOME = os.environ['COPY_OF_SOFTWARE_HOME']
os.environ['INSTANCE_HOME'] = INSTANCE_HOME =\
os.environ['COPY_OF_INSTANCE_HOME']
os.environ['SOFTWARE_HOME'] = SOFTWARE_HOME =\
os.environ['COPY_OF_SOFTWARE_HOME']
else:
cfg = App.config.getConfiguration()
cfg.instancehome = os.environ['COPY_OF_INSTANCE_HOME']
......@@ -367,11 +370,18 @@ class ERP5TypeTestCase(PortalTestCase):
self.failUnless(i in a, msg)
self.assertEquals(len(a), len(b), msg)
def setupERP5Site(business_template_list=(), app=None, portal_name=portal_name, title='',quiet=0,
light_install=1,create_activities=1,hot_reindexing=1):
def setupERP5Site( business_template_list=(),
app=None,
portal_name=portal_name,
title='',
quiet=0,
light_install=1,
create_activities=1,
hot_reindexing=1 ):
'''
Creates an ERP5 site.
business_template_list must be specified correctly (e.g. '("erp5_common", )').
business_template_list must be specified correctly
(e.g. '("erp5_common", )').
'''
try:
if app is None:
......@@ -382,7 +392,8 @@ def setupERP5Site(business_template_list=(), app=None, portal_name=portal_name,
try:
_start = time.time()
# Add user and log in
if not quiet: ZopeTestCase._print('\nAdding ERP5TypeTestCase user ... \n')
if not quiet:
ZopeTestCase._print('\nAdding ERP5TypeTestCase user ... \n')
uf = app.acl_users
uf._doAddUser('ERP5TypeTestCase', '', ['Manager'], [])
user = uf.getUserById('ERP5TypeTestCase').__of__(uf)
......@@ -444,10 +455,13 @@ def setupERP5Site(business_template_list=(), app=None, portal_name=portal_name,
from Products.ERP5Type.Base import _aq_reset
_aq_reset()
# Log out
if not quiet: ZopeTestCase._print('Logout ... \n')
if not quiet:
ZopeTestCase._print('Logout ... \n')
noSecurityManager()
if not quiet: ZopeTestCase._print('done (%.3fs)\n' % (time.time()-_start,))
if not quiet: ZopeTestCase._print('Ran Unit test of %s\n' % title)
if not quiet:
ZopeTestCase._print('done (%.3fs)\n' % (time.time()-_start,))
if not quiet:
ZopeTestCase._print('Ran Unit test of %s\n' % title)
finally:
get_transaction().commit()
ZopeTestCase.close(app)
......
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