[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/tests - testAttributePrincipalPermissionManager.py:1.1.2.4 testAttributePrincipalRoleManager.py:1.1.2.6
Casey Duncan
casey@zope.com
Thu, 28 Mar 2002 17:02:15 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/tests
In directory cvs.zope.org:/tmp/cvs-serv30227/App/Security/tests
Modified Files:
Tag: Zope-3x-branch
testAttributePrincipalPermissionManager.py
testAttributePrincipalRoleManager.py
Log Message:
Refactored security managers to store data using mementos. Removed previous
storage marker interfaces.
=== Zope3/lib/python/Zope/App/Security/tests/testAttributePrincipalPermissionManager.py 1.1.2.3 => 1.1.2.4 ===
import unittest
+from Zope.App.OFS.Memento.IAttributeMementoStorable \
+ import IAttributeMementoStorable
+from Zope.ComponentArchitecture import provideAdapter
+from Zope.App.OFS.Memento.IMementoBag import IMementoBag
+from Zope.App.OFS.Memento.AttributeMementoBag import AttributeMementoBag
from Zope.App.Security.PermissionRegistry \
import permissionRegistry as permregistry
from Zope.App.Security.PrincipalRegistry \
import principalRegistry as prinregistry
-from Zope.App.Security.IAttributePrincipalPermissionManageable \
- import IAttributePrincipalPermissionManageable
from Zope.App.Security.AttributePrincipalPermissionManager \
import AttributePrincipalPermissionManager
from Zope.App.Security.Settings import Allow, Deny, Unset
from Zope.Testing.CleanUp import CleanUp # Base class w registry cleanup
class Manageable:
- __implements__ = IAttributePrincipalPermissionManageable
+ __implements__ = IAttributeMementoStorable
class Test(CleanUp, unittest.TestCase):
+
+ def setUp(self):
+ CleanUp.setUp(self)
+ provideAdapter(IAttributeMementoStorable, IMementoBag,
+ AttributeMementoBag)
def _make_principal(self, id=None, title=None):
p = prinregistry.definePrincipal(
=== Zope3/lib/python/Zope/App/Security/tests/testAttributePrincipalRoleManager.py 1.1.2.5 => 1.1.2.6 ===
import unittest
+from Zope.App.OFS.Memento.IAttributeMementoStorable \
+ import IAttributeMementoStorable
+from Zope.ComponentArchitecture import provideAdapter
+from Zope.App.OFS.Memento.IMementoBag import IMementoBag
+from Zope.App.OFS.Memento.AttributeMementoBag import AttributeMementoBag
from Zope.App.Security.RoleRegistry import roleRegistry as rregistry
from Zope.App.Security.PrincipalRegistry import principalRegistry as pregistry
from Zope.App.Security.AttributePrincipalRoleManager \
import AttributePrincipalRoleManager
-from Zope.App.Security.IAttributePrincipalRoleManageable \
- import IAttributePrincipalRoleManageable
from Zope.App.Security.Settings import Assign, Remove
from Zope.Testing.CleanUp import CleanUp # Base class w registry cleanup
class Manageable:
- __implements__ = IAttributePrincipalRoleManageable
+ __implements__ = IAttributeMementoStorable
class Test(CleanUp, unittest.TestCase):
-
+
+ def setUp(self):
+ CleanUp.setUp(self)
+ provideAdapter(IAttributeMementoStorable, IMementoBag,
+ AttributeMementoBag)
+
def _make_principal(self, id=None, title=None):
p = pregistry.definePrincipal(
id or 'APrincipal',