Commit 8ed87db7 authored by Nicolas Dumazet's avatar Nicolas Dumazet

Move the creation of user 'ERP5TypeTestCase' at portal level outside of the

login() method, in setUpERP5Site: login() should only... log you in!


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29682 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 89a64342
......@@ -281,11 +281,7 @@ class ERP5TypeTestCase(PortalTestCase):
"""
Most of the time, we need to login before doing anything
"""
uf = self.getPortal().acl_users
uf._doAddUser('ERP5TypeTestCase', '', ['Manager', 'Member', 'Assignee',
'Assignor', 'Author', 'Auditor', 'Associate'], [])
user = uf.getUserById('ERP5TypeTestCase').__of__(uf)
newSecurityManager(None, user)
PortalTestCase.login(self, 'ERP5TypeTestCase')
def _setupUser(self):
'''Creates the default user.'''
......@@ -784,6 +780,12 @@ class ERP5TypeTestCase(PortalTestCase):
if not quiet:
ZopeTestCase._print('done (%.3fs)\n' % (time.time() - start))
# Create a Manager user at the Portal level
uf = self.getPortal().acl_users
uf._doAddUser('ERP5TypeTestCase', '', ['Manager', 'Member', 'Assignee',
'Assignor', 'Author', 'Auditor', 'Associate'], [])
user = uf.getUserById('ERP5TypeTestCase').__of__(uf)
setup_once = getattr(self, 'setUpOnce', None)
if setup_once is not None and \
not getattr(portal, 'set_up_once_called', 0):
......
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