Commit 27269244 authored by Alexandre Boeglin's avatar Alexandre Boeglin

As we commit the transaction after each sequence step, the objects remain in

the zodb beetween two sequences in the same unit test.
When using PluggableAuthSystem, trying to add an user that already exists will
fail.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4535 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 422a5b81
......@@ -7,7 +7,7 @@
__version__ = '0.3.0'
from Testing import ZopeTestCase
from Testing.ZopeTestCase.PortalTestCase import PortalTestCase
from Testing.ZopeTestCase.PortalTestCase import PortalTestCase, user_name
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type.Utils import getLocalPropertySheetList, removeLocalPropertySheet
from Products.ERP5Type.Utils import getLocalDocumentList, removeLocalDocument
......@@ -139,6 +139,13 @@ class ERP5TypeTestCase(PortalTestCase):
user = uf.getUserById('ERP5TypeTestCase').__of__(uf)
newSecurityManager(None, user)
def _setupUser(self):
'''Creates the default user.'''
uf = self.portal.acl_users
# do nothing if the user already exists
if not uf.getUser(user_name):
uf._doAddUser(user_name, 'secret', ['Member'], [])
def setUp(self):
'''Sets up the fixture. Do not override,
use the hooks instead.
......
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