Commit a3a75483 authored by Jérome Perrin's avatar Jérome Perrin

fix typos and move person creation in a method.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8798 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 634a6327
...@@ -47,7 +47,7 @@ except ImportError: ...@@ -47,7 +47,7 @@ except ImportError:
from Interface.Verify import verifyClass from Interface.Verify import verifyClass
class TestERP5Security(ERP5TypeTestCase): class TestERP5Security(ERP5TypeTestCase):
"""Test invoice are created from orders then packing lists. """ """Test ERP5 Security."""
RUN_ALL_TESTS = 1 RUN_ALL_TESTS = 1
...@@ -67,7 +67,7 @@ class TestERP5Security(ERP5TypeTestCase): ...@@ -67,7 +67,7 @@ class TestERP5Security(ERP5TypeTestCase):
newSecurityManager(None, user) newSecurityManager(None, user)
def test_GroupManagerInterfaces(self, run=RUN_ALL_TESTS): def test_GroupManagerInterfaces(self, run=RUN_ALL_TESTS):
"""Tests group manager pluign respects interfaces.""" """Tests group manager plugin respects interfaces."""
if not run: if not run:
return return
from Products.PluggableAuthService.interfaces.plugins import IGroupsPlugin from Products.PluggableAuthService.interfaces.plugins import IGroupsPlugin
...@@ -75,7 +75,7 @@ class TestERP5Security(ERP5TypeTestCase): ...@@ -75,7 +75,7 @@ class TestERP5Security(ERP5TypeTestCase):
verifyClass(IGroupsPlugin, ERP5GroupManager) verifyClass(IGroupsPlugin, ERP5GroupManager)
def test_UserManagerInterfaces(self, run=RUN_ALL_TESTS): def test_UserManagerInterfaces(self, run=RUN_ALL_TESTS):
"""Tests user manager pluign respects interfaces.""" """Tests user manager plugin respects interfaces."""
if not run: if not run:
return return
from Products.PluggableAuthService.interfaces.plugins import\ from Products.PluggableAuthService.interfaces.plugins import\
...@@ -85,7 +85,7 @@ class TestERP5Security(ERP5TypeTestCase): ...@@ -85,7 +85,7 @@ class TestERP5Security(ERP5TypeTestCase):
verifyClass(IUserEnumerationPlugin, ERP5UserManager) verifyClass(IUserEnumerationPlugin, ERP5UserManager)
def test_RolesManagerInterfaces(self, run=RUN_ALL_TESTS): def test_RolesManagerInterfaces(self, run=RUN_ALL_TESTS):
"""Tests group manager pluign respects interfaces.""" """Tests group manager plugin respects interfaces."""
if not run: if not run:
return return
from Products.PluggableAuthService.interfaces.plugins import IRolesPlugin from Products.PluggableAuthService.interfaces.plugins import IRolesPlugin
...@@ -99,18 +99,22 @@ class TestERP5Security(ERP5TypeTestCase): ...@@ -99,18 +99,22 @@ class TestERP5Security(ERP5TypeTestCase):
self.failUnless(isinstance(self.getPortal().acl_users, self.failUnless(isinstance(self.getPortal().acl_users,
PluggableAuthService.PluggableAuthService)) PluggableAuthService.PluggableAuthService))
def test_MultiplePersonReference(self, run=RUN_ALL_TESTS): def _makePerson(self, **kw):
"""Tests that it's refused to create two Person with same reference.""" """Creates a person in person module, and returns the object, after
if not run: indexing is done. """
return
person_module = self.getPersonModule() person_module = self.getPersonModule()
new_person = person_module.newContent( new_person = person_module.newContent(
portal_type='Person', portal_type='Person', **kw)
reference='new_person')
get_transaction().commit() get_transaction().commit()
self.tic() self.tic()
self.assertRaises(RuntimeError, person_module.newContent, return new_person
portal_type='Person', reference='new_person')
def test_MultiplePersonReference(self, run=RUN_ALL_TESTS):
"""Tests that it's refused to create two Persons with same reference."""
if not run:
return
self._makePerson(reference='new_person')
self.assertRaises(RuntimeError, self._makePerson, reference='new_person')
if __name__ == '__main__': if __name__ == '__main__':
framework() framework()
......
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