[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/tests - testContainerTraverser.py:1.1.2.7
Jim Fulton
jim@zope.com
Fri, 7 Jun 2002 10:41:38 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Container/tests
In directory cvs.zope.org:/tmp/cvs-serv12187/lib/python/Zope/App/OFS/Container/tests
Modified Files:
Tag: Zope-3x-branch
testContainerTraverser.py
Log Message:
Merging in Zope3InWonderland-branch, which implemented the following
proposals (see
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/OldProposals):
- RenameAllowToRequire
- GroupClassRelatedDirectivesInClassDirective
- ViewInterfaceAndSimplification
- ConsistentUseOfSpacesAsDelimitersInZCMLAttributes
- TwoArgumentViewConstructors
- ImplementsInZCML
- SimpleViewCreationInZCML
- RemoveGetView
- ReplaceProtectWithAllow
- ViewMethodsAsViews
- MergeProtectionAndComponentDefinitions
There were also various security fixes resulting of better integration
of security with components.
=== Zope3/lib/python/Zope/App/OFS/Container/tests/testContainerTraverser.py 1.1.2.6 => 1.1.2.7 ===
from Zope.ComponentArchitecture.tests.PlacelessSetup import PlacelessSetup
-
class I(Interface): pass
@@ -52,7 +51,7 @@
class View:
- def __init__(self, comp):
+ def __init__(self, comp, request):
self._comp = comp
@@ -66,7 +65,7 @@
c = Container( foo=foo )
req = Request( I, '')
- T = ContainerTraverser(c)
+ T = ContainerTraverser(c, req)
self.failUnless(T.publishTraverse(req,'foo') is foo)
self.assertRaises(NotFoundError , T.publishTraverse, req ,'morebar')
@@ -74,21 +73,21 @@
def testView(self):
""" test getting a view """
-
+
foo = Container()
c = Container( foo=foo )
req = Request( I, '')
- T = ContainerTraverser(c)
- getService(None,'Views').provideView(IContainer, 'foo', I, View)
+ T = ContainerTraverser(c, req)
+ getService(None,'Views').provideView(IContainer, 'viewfoo', I, [View])
- self.failUnless(T.publishTraverse(req,'foo;view').__class__ is View )
+ self.failUnless(T.publishTraverse(req,'viewfoo').__class__ is View )
self.failUnless(T.publishTraverse(req,'foo') is foo)
self.assertRaises(NotFoundError , T.publishTraverse, req, 'morebar')
self.assertRaises(NotFoundError , T.publishTraverse, req,
- 'morebar;view')
+ 'view::morebar')