[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/Browser/tests - TestViews.py:1.1.2.3 testAttributePublisher.py:1.1.2.13 testBrowserRequest.py:1.1.4.7 testDirectives.py:NONE

Jim Fulton jim@zope.com
Fri, 7 Jun 2002 10:41:58 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv12187/lib/python/Zope/Publisher/Browser/tests

Modified Files:
      Tag: Zope-3x-branch
	TestViews.py testAttributePublisher.py testBrowserRequest.py 
Removed Files:
      Tag: Zope-3x-branch
	testDirectives.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/Publisher/Browser/tests/TestViews.py 1.1.2.2 => 1.1.2.3 ===
 
 from Interface import Interface
-from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
+from Zope.Publisher.Browser.BrowserView import BrowserView
+from Zope.Publisher.Browser.IBrowserPresentation import IBrowserPresentation
 
 class IC(Interface): pass
 
-class V1:
-    __implements__ = IBrowserPublisher
+class V1(BrowserView): pass
 
-    def __init__(self,context): 
-        self._context = context 
-
-class VZMI(V1):
-    pass
+class VZMI(V1): pass
 
 class R1:
-    __implements__ = IBrowserPublisher
-
-r1 = R1()
+    __implements__ = IBrowserPresentation
+    def __init__(self, request): self.request = request
 
 class RZMI(R1):
     pass
-
-rZMI = RZMI()


=== Zope3/lib/python/Zope/Publisher/Browser/tests/testAttributePublisher.py 1.1.2.12 => 1.1.2.13 ===
 import unittest, sys
 
+from Zope.Publisher.Browser.BrowserView import BrowserView
 from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
-from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
 
 from Interface.Verify import verifyClass
 from Interface.Implements import instancesOfObjectImplements
 
-class Presentation(AttributePublisher):
+class Presentation(BrowserView, AttributePublisher):
     index = 'index'
     action = 'action'
     foo = 'foo'
 
 class TestAttributePublisher(unittest.TestCase):
     def setUp(self):
-        self.pres = Presentation()
-
-    def testImplementsIBrowserPublisher(self):
-        self.failUnless(IBrowserPublisher.isImplementedBy(self.pres))
+        self.pres = Presentation(None, None)
 
     def testInterfacesVerify(self):
         for interface in instancesOfObjectImplements(Presentation):


=== Zope3/lib/python/Zope/Publisher/Browser/tests/testBrowserRequest.py 1.1.4.6 => 1.1.4.7 ===
 from Zope.Publisher.Publish import publish
 from Zope.Publisher.DefaultPublication import DefaultPublication
-from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
-from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
+from Zope.Publisher.Browser.IBrowserPresentation import IBrowserPresentation
 
 from StringIO import StringIO
 
@@ -107,15 +106,15 @@
             "\r\n"
             "'5', 6")
 
-    def testIViewRequest(self):
+    def testIPresentationRequest(self):
         ''' test the IView request'''
     
         r = self._createRequest()
 
-        self.failUnless( r.getViewType() is IBrowserPublisher)
-        self.assertEqual( r.getViewSkin(), '')
+        self.failUnless( r.getPresentationType() is IBrowserPresentation)
+        self.assertEqual( r.getPresentationSkin(), '')
         r.setViewSkin( 'morefoo' )
-        self.assertEqual( r.getViewSkin(), 'morefoo')
+        self.assertEqual( r.getPresentationSkin(), 'morefoo')
 
     def testNoDefault(self):
         request = self._createRequest()

=== Removed File Zope3/lib/python/Zope/Publisher/Browser/tests/testDirectives.py ===