Commit f7a1a858 authored by Hanno Schlichting's avatar Hanno Schlichting

Get rid of some more testing dependencies in AccessControl by moving...

Get rid of some more testing dependencies in AccessControl by moving integration tests into higher level packages
parent 82d43c24
......@@ -35,11 +35,8 @@ AccessControl
- Test only dependencies:
* OFS
* Products.PythonScripts
* Products.SiteErrorLog
* Testing
* transaction
* Zope2
DocumentTemplate
----------------
......
<configure xmlns="http://namespaces.zope.org/zope"
i18n_domain="Zope2">
<include package="Zope2.App" file="meta.zcml"/>
<!-- Create permissions declared in ZCML if they don't exist already -->
<subscriber
for="zope.security.interfaces.IPermission
......
......@@ -4,11 +4,13 @@ $Id$
"""
import unittest
import Testing
import ZODB
from persistent import Persistent
from Acquisition import Implicit, aq_inner
from AccessControl.Owned import Owned
class FauxUser(Implicit):
def __init__(self, id):
......@@ -17,11 +19,13 @@ class FauxUser(Implicit):
def getId(self):
return self._id
class FauxUserFolder(Implicit):
def getUserById(self, id, default):
return FauxUser(id)
class FauxRoot(Implicit):
def getPhysicalRoot(self):
......@@ -46,26 +50,40 @@ class FauxRoot(Implicit):
return obj
class Folder(Implicit, Persistent, Owned):
def __init__(self, id):
self.id = id
self.names = set()
def _setObject(self, name, value):
setattr(self, name, value)
self.names.add(name)
def objectValues(self):
result = []
for name in self.names:
result.append(getattr(self, name))
return result
class OwnedTests(unittest.TestCase):
def _getTargetClass(self):
from AccessControl.Owned import Owned
return Owned
def _makeOne(self, *args, **kw):
return self._getTargetClass()(*args, **kw)
def _makeDummy(self, *args, **kw):
from AccessControl.Owned import Owned
class Dummy(Implicit, Owned):
pass
return Dummy(*args, **kw)
def test_z3interfaces(self):
def test_interfaces(self):
from AccessControl.interfaces import IOwned
from AccessControl.Owned import Owned
from zope.interface.verify import verifyClass
verifyClass(IOwned, Owned)
......@@ -182,7 +200,6 @@ class OwnershipChangeTests(unittest.TestCase):
def setUp(self):
from AccessControl.Owned import UnownableOwner
from AccessControl.User import UserFolder
from OFS.Folder import Folder
super(OwnershipChangeTests, self).setUp()
self.root = FauxRoot()
......
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