[z3-checkins] r5202 - z3/Five/trunk/tests
dreamcatcher at codespeak.net
dreamcatcher at codespeak.net
Mon Jun 21 18:33:21 MEST 2004
Author: dreamcatcher
Date: Mon Jun 21 18:33:21 2004
New Revision: 5202
Added:
z3/Five/trunk/tests/dummy.py (contents, props changed)
Modified:
z3/Five/trunk/tests/test_security.py
Log:
Rearrange the dummies a bit to make imports behave correctly.
Added: z3/Five/trunk/tests/dummy.py
==============================================================================
--- (empty file)
+++ z3/Five/trunk/tests/dummy.py Mon Jun 21 18:33:21 2004
@@ -0,0 +1,29 @@
+from zope.interface import Interface, implements
+
+from Products.Five.browser import BrowserView
+from AccessControl import ClassSecurityInfo
+
+class IDummy(Interface):
+ """Just a marker interface"""
+
+class DummyView(BrowserView):
+ """A dummy view"""
+
+ def foo(self):
+ """A foo"""
+ return 'A foo view'
+
+class Dummy1:
+ implements(IDummy)
+ def foo(self): pass
+ def bar(self): pass
+ def baz(self): pass
+ def keg(self): pass
+ def wot(self): pass
+
+class Dummy2(Dummy1):
+ security = ClassSecurityInfo()
+ security.declarePublic('foo')
+ security.declareProtected('View management screens', 'bar')
+ security.declarePrivate('baz')
+ security.declareProtected('View management screens', 'keg')
Modified: z3/Five/trunk/tests/test_security.py
==============================================================================
--- z3/Five/trunk/tests/test_security.py (original)
+++ z3/Five/trunk/tests/test_security.py Mon Jun 21 18:33:21 2004
@@ -25,41 +25,13 @@
from zope.configuration import xmlconfig
from zope.component import getView
-from zope.interface import Interface, implements
from zope.testing.cleanup import CleanUp
from Products.Five import zcml
-from Products.Five.browser import BrowserView
from Products.Five.viewable import FakeRequest
from Products.Five.security.permission import clearSecurityInfo
-from AccessControl import ClassSecurityInfo
-from AccessControl.PermissionRole import PermissionRole
+from Products.Five.tests.dummy import Dummy1, Dummy2
from Globals import InitializeClass
-class IDummy(Interface):
- """Just a marker interface"""
-
-class DummyView(BrowserView):
- """A dummy view"""
-
- def foo(self):
- """A foo"""
- return 'A foo view'
-
-class Dummy1:
- implements(IDummy)
- def foo(self): pass
- def bar(self): pass
- def baz(self): pass
- def keg(self): pass
- def wot(self): pass
-
-class Dummy2(Dummy1):
- security = ClassSecurityInfo()
- security.declarePublic('foo')
- security.declareProtected('View management screens', 'bar')
- security.declarePrivate('baz')
- security.declareProtected('View management screens', 'keg')
-
class PageSecurityTestCase(CleanUp, ZopeTestCase.ZopeTestCase):
def setUp(self):
@@ -81,8 +53,8 @@
xmlns:browser="http://namespaces.zope.org/browser">
<browser:page
- for="Five.tests.test_security.IDummy"
- class="Five.tests.test_security.DummyView"
+ for="Products.Five.tests.dummy.IDummy"
+ class="Products.Five.tests.dummy.DummyView"
attribute="foo"
name="foo.txt"
permission="zope.ViewManagementScreens"
@@ -125,7 +97,7 @@
<configure xmlns="http://namespaces.zope.org/zope">
<content
- class="Five.tests.test_security.Dummy1">
+ class="Products.Five.tests.dummy.Dummy1">
<allow attributes="foo" />
More information about the z3-checkins
mailing list