[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/dav/tests/test_propfind.py Use zapi and ztapi.

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Sep 17 12:15:46 EDT 2004


Log message for revision 27574:
  
  Use zapi and ztapi.
  
  


Changed:
  U   Zope3/trunk/src/zope/app/dav/tests/test_propfind.py


-=-
Modified: Zope3/trunk/src/zope/app/dav/tests/test_propfind.py
===================================================================
--- Zope3/trunk/src/zope/app/dav/tests/test_propfind.py	2004-09-17 16:15:44 UTC (rev 27573)
+++ Zope3/trunk/src/zope/app/dav/tests/test_propfind.py	2004-09-17 16:15:46 UTC (rev 27574)
@@ -20,8 +20,7 @@
 from unittest import TestCase, TestSuite, main, makeSuite
 from datetime import datetime
 
-from zope.interface import implements, directlyProvides
-from zope.component import getView
+from zope.interface import Interface, implements, directlyProvides
 from zope.publisher.interfaces.http import IHTTPRequest
 from zope.pagetemplate.tests.util import normalize_xml
 from zope.schema import getFieldNamesInOrder
@@ -134,11 +133,10 @@
         root['folder'] = folder
         self.zpt = traverse(root, 'zpt')
         self.file = traverse(root, 'file')
-        ps = zapi.getGlobalService(zapi.servicenames.Presentation)
-        ps.provideView(None, 'absolute_url', IHTTPRequest,
-                       AbsoluteURL)
-        ps.provideView(None, 'PROPFIND', IHTTPRequest,
-                       propfind.PROPFIND)
+        ztapi.provideView(None, IHTTPRequest, Interface,
+                          'absolute_url', AbsoluteURL)
+        ztapi.provideView(None, IHTTPRequest, Interface,
+                          'PROPFIND', propfind.PROPFIND)
         ztapi.browserViewProviding(IText, TextDAVWidget, IDAVWidget)
         ztapi.browserViewProviding(ITextLine, TextDAVWidget, IDAVWidget)
         ztapi.browserViewProviding(IDatetime, TextDAVWidget, IDAVWidget)
@@ -272,7 +270,7 @@
                                  headers={'Content-type':'text/xml',
                                           'Depth':'0'})
 
-        resource_url = str(getView(zpt, 'absolute_url', request))
+        resource_url = str(zapi.getView(zpt, 'absolute_url', request))
         expect = '''<?xml version="1.0" ?>
         <multistatus xmlns="DAV:">
         <response>
@@ -313,7 +311,7 @@
                                  headers={'Content-type':'text/xml',
                                           'Depth':'0'})
 
-        resource_url = str(getView(zpt, 'absolute_url', request))
+        resource_url = str(zapi.getView(zpt, 'absolute_url', request))
         expect = '''<?xml version="1.0" ?>
         <multistatus xmlns="DAV:">
         <response>
@@ -355,7 +353,7 @@
                                  headers={'Content-type':'text/xml',
                                           'Depth':'0'})
 
-        resource_url = str(getView(zpt, 'absolute_url', request))
+        resource_url = str(zapi.getView(zpt, 'absolute_url', request))
         expect = '''<?xml version="1.0" ?>
         <multistatus xmlns="DAV:">
         <response>
@@ -393,7 +391,7 @@
                                  headers={'Content-type':'text/xml',
                                           'Depth':'0'})
 
-        resource_url = str(getView(zpt, 'absolute_url', request))
+        resource_url = str(zapi.getView(zpt, 'absolute_url', request))
         props_xml = ''
         props = getFieldNamesInOrder(IZopeDublinCore)
         for p in props:
@@ -438,7 +436,7 @@
                                  headers={'Content-type':'text/xml',
                                           'Depth':'0'})
 
-        resource_url = str(getView(folder, 'absolute_url', request))
+        resource_url = str(zapi.getView(folder, 'absolute_url', request))
         resource_url = "%s/" % resource_url
         props_xml = ''
         props = getFieldNamesInOrder(IZopeDublinCore)
@@ -485,7 +483,7 @@
                                  headers={'Content-type':'text/xml',
                                           'Depth':'1'})
 
-        resource_url = str(getView(folder, 'absolute_url', request))
+        resource_url = str(zapi.getView(folder, 'absolute_url', request))
         resource_url = "%s/" % resource_url
         props_xml = ''
         props = getFieldNamesInOrder(IZopeDublinCore)
@@ -639,7 +637,7 @@
                                  headers={'Content-type':'text/xml',
                                           'Depth':'infinity'})
 
-        resource_url = str(getView(folder, 'absolute_url', request))
+        resource_url = str(zapi.getView(folder, 'absolute_url', request))
         resource_url = "%s/" % resource_url
         props_xml = ''
         props = getFieldNamesInOrder(IZopeDublinCore)



More information about the Zope3-Checkins mailing list