[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/XMLRPC/tests - TestViews.py:1.1.4.3 testDirectives.py:1.1.4.5 testXMLRPCRequest.py:1.1.2.3

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


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

Modified Files:
      Tag: Zope-3x-branch
	TestViews.py testDirectives.py testXMLRPCRequest.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/XMLRPC/tests/TestViews.py 1.1.4.2 => 1.1.4.3 ===
     __implements__ = IXMLRPCPublisher
 
-    def __init__(self,context): 
-        self._context = context 
+    def __init__(self, context, request): 
+        self.context = context
+        self.request = request
 
 class VZMI(V1):
     pass
 
 class R1:
+    def __init__(self, request): 
+        self.request = request
+    
     __implements__ = IXMLRPCPublisher
 
-r1 = R1()
-
 class RZMI(R1):
     pass
-
-rZMI = RZMI()


=== Zope3/lib/python/Zope/Publisher/XMLRPC/tests/testDirectives.py 1.1.4.4 => 1.1.4.5 ===
 from Zope.Publisher.XMLRPC.tests.TestViews import IC, V1, VZMI, R1, RZMI
 from Zope.ComponentArchitecture.tests.PlacelessSetup import PlacelessSetup
-from Zope.ComponentArchitecture import getView
+from Zope.ComponentArchitecture import queryView
 from cStringIO import StringIO
 
+from Zope.ComponentArchitecture.tests.Request import Request
+
 template = """<zopeConfigure
    xmlns='http://namespaces.zope.org/zope'
    xmlns:xmlrpc='http://namespaces.zope.org/xmlrpc'>
@@ -33,12 +35,13 @@
     def testView(self):
 
         ob = Ob()
-        self.assertEqual(getView(ob, 'test', IXMLRPCPublisher, None), None)
+        self.assertEqual(queryView(ob, 'test', Request(IXMLRPCPublisher)),
+                         None)
 
         xmlconfig(StringIO(template % (
             '''
             <directive name="view"
-              attributes="component, name, for, layer"
+              attributes="component name for layer"
               handler="Zope.Publisher.XMLRPC.metaConfigure.view"
               namespace="http://namespaces.zope.org/xmlrpc" />
             <xmlrpc:view name="test"
@@ -47,7 +50,7 @@
             '''
             ))) 
         
-        self.assertEqual(getView(ob, 'test', IXMLRPCPublisher, None
+        self.assertEqual(queryView(ob, 'test', Request(IXMLRPCPublisher), None
                                  ).__class__, V1)
 
 


=== Zope3/lib/python/Zope/Publisher/XMLRPC/tests/testXMLRPCRequest.py 1.1.2.2 => 1.1.2.3 ===
 
 
-    def testIViewRequest(self):
+    def testIPresentationRequest(self):
         ''' test the IView request'''
     
         r = self._createRequest()
-        self.failUnless( r.getViewType() is IXMLRPCPublisher)
+        self.failUnless( r.getPresentationType() is IXMLRPCPublisher)
 
     
     def testProcessInput(self):