Commit 6c62168a authored by wenjie.zheng's avatar wenjie.zheng

testERP5Security.py: avoid test from deleting workflow module by error, add...

testERP5Security.py: avoid test from deleting workflow module by error, add erp5workflow method compability.
parent 1fef041d
...@@ -372,10 +372,13 @@ class TestUserManagement(ERP5TypeTestCase): ...@@ -372,10 +372,13 @@ class TestUserManagement(ERP5TypeTestCase):
def test_DeletedPersonIsNotUser(self): def test_DeletedPersonIsNotUser(self):
p = self._makePerson(reference='the_user', password='secret') p = self._makePerson(reference='the_user', password='secret')
self._assertUserExists('the_user', 'secret') self._assertUserExists('the_user', 'secret')
if not p.getTypeInfo().getTypeERP5WorkflowList():
p.delete() p.delete()
else:
p.dlt()
self.commit() self.commit()
### zwj: even the user has been delete, the information exist? why this test?
self._assertUserDoesNotExists('the_user', 'secret') self._assertUserDoesNotExists('the_user', 'secret')
def test_ReallyDeletedPersonIsNotUser(self): def test_ReallyDeletedPersonIsNotUser(self):
...@@ -498,8 +501,6 @@ class TestLocalRoleManagement(ERP5TypeTestCase): ...@@ -498,8 +501,6 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
# any member can add organisations # any member can add organisations
self.portal.organisation_module.manage_permission( self.portal.organisation_module.manage_permission(
'Add portal content', roles=['Member', 'Manager'], acquire=1) 'Add portal content', roles=['Member', 'Manager'], acquire=1)
### zwj : pdb
#pdb.set_trace()
self.username = 'usérn@me' self.username = 'usérn@me'
# create a user and open an assignement # create a user and open an assignement
pers = self.getPersonModule().newContent(portal_type='Person', pers = self.getPersonModule().newContent(portal_type='Person',
...@@ -514,7 +515,6 @@ class TestLocalRoleManagement(ERP5TypeTestCase): ...@@ -514,7 +515,6 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
self.tic() self.tic()
def beforeTearDown(self): def beforeTearDown(self):
#pdb.set_trace()
"""Called before teardown.""" """Called before teardown."""
# clear base categories # clear base categories
self.person.getParentValue().manage_delObjects([self.person.getId()]) self.person.getParentValue().manage_delObjects([self.person.getId()])
...@@ -526,7 +526,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase): ...@@ -526,7 +526,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
ti.manage_delObjects([x.id for x in ti.getRoleInformationList()]) ti.manage_delObjects([x.id for x in ti.getRoleInformationList()])
# clear modules # clear modules
for module in self.portal.objectValues(): for module in self.portal.objectValues():
if module.getId().endswith('_module'): if module.getId().endswith('_module') and module.getId() != 'workflow_module':
module.manage_delObjects(list(module.objectIds())) module.manage_delObjects(list(module.objectIds()))
# commit this # commit this
self.tic() self.tic()
......
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