[Zope3-checkins] CVS: Zope3/src/zope/app/browser/skins/rotterdam/tests - test_xmlnavigationviews.py:1.9

Jim Fulton cvs-admin at zope.org
Fri Nov 21 12:12:30 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/browser/skins/rotterdam/tests
In directory cvs.zope.org:/tmp/cvs-serv31883/src/zope/app/browser/skins/rotterdam/tests

Modified Files:
	test_xmlnavigationviews.py 
Log Message:
Changed to use the new ztapi module, which provides handy functions
for setting up adapters and views for tests.  This is needed because
there are no-longer global adapter and view services sitting around as
module globals.


=== Zope3/src/zope/app/browser/skins/rotterdam/tests/test_xmlnavigationviews.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/browser/skins/rotterdam/tests/test_xmlnavigationviews.py:1.8	Sun Sep 21 13:30:41 2003
+++ Zope3/src/zope/app/browser/skins/rotterdam/tests/test_xmlnavigationviews.py	Fri Nov 21 12:11:59 2003
@@ -20,13 +20,17 @@
 #import sys
 #sys.path.insert(0, r"c:\Zope3\src")
 
+from zope.app.tests import ztapi
+from zope.app.content.file import File
+from zope.app.traversing import traverse
 from zope.interface import implements
 from unittest import TestCase, TestLoader, TextTestRunner
 from zope.app.services.tests.eventsetup import EventSetup
 from zope.pagetemplate.tests.util import check_xml
+from zope.publisher.interfaces.browser import IBrowserPublisher
 from zope.app.browser.skins.rotterdam.tests import util
 from zope.app.browser.skins.rotterdam.xmlobject \
-    import ReadContainerXmlObjectView
+     import ReadContainerXmlObjectView
 from zope.app.interfaces.container import IReadContainer
 from zope.app.browser.skins.rotterdam.xmlobject import XmlObjectView
 from zope.publisher.browser import TestRequest
@@ -50,15 +54,11 @@
         treeView = rcxov(self.rootFolder, TestRequest()).children
         check_xml(treeView(), util.read_output('test4.xml'))
 
-        from zope.app.content.file import File
-        from zope.app.traversing import traverse
         file1 = File()
         self.folder1_1_1["file1"] = file1
         self.file1 = traverse(self.rootFolder,
                               '/folder1/folder1_1/folder1_1_1/file1')
-        from zope.component.view import provideView
-        from zope.publisher.interfaces.browser import IBrowserPresentation
-        from zope.publisher.interfaces.browser import IBrowserPublisher
+
         class ReadContainerView(ReadContainerXmlObjectView):
             implements(IBrowserPublisher)
             def browserDefault(self, request):
@@ -67,8 +67,9 @@
                 raise NotFoundError(self, name, request)
             def __call__(self):
                 return self.singleBranchTree()
-        provideView(IReadContainer, 'singleBranchTree.xml',
-                    IBrowserPresentation, ReadContainerView)
+            
+        ztapi.browserView(IReadContainer, 'singleBranchTree.xml',
+                          ReadContainerView)
 
         treeView = rcxov(self.folder1_1_1, TestRequest()).singleBranchTree
         check_xml(treeView(), util.read_output('test5.xml'))




More information about the Zope3-Checkins mailing list