[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests - testContents.py:1.3

Jim Fulton jim@zope.com
Thu, 13 Jun 2002 19:16:13 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv10697/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests

Modified Files:
	testContents.py 
Log Message:
Got icons working, and, along the way:

- Implemented the icon directive

- Implemented
  http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ResourcesProposal

- Added a special view, named '', for service manager containers that
  allows resources to have URLs like:

  http://foo.com/@@/resourcename

- Fixed some server code that caused HTTP response data to get
  promoted to unicode

- Updated the folder contents page to display icons.

- Ported icons for folder, file, image, and zptpage. Many more icons
  need to be ported or created.



=== Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests/testContents.py 1.2 => 1.3 ===
 from Zope.App.OFS.Container.Views.Browser.tests.testContents \
      import BaseTestContentsBrowserView
+from Zope.Publisher.Browser.BrowserRequest import TestRequest
 
 class IDummy(Interface):
     pass
 
 class Dummy:
     __implements__ = IDummy
+
+
     
 class Test(BaseTestContentsBrowserView, unittest.TestCase):
 
@@ -37,12 +40,13 @@
         return ServiceManager()
 
     def _TestView__newView(self, container):
-        return ServiceManagerContents(container, None)
+        from Zope.Publisher.Browser.BrowserRequest import TestRequest
+        return ServiceManagerContents(container, TestRequest())
 
     def testExtractContents(self):
         """ Does _extractContents return the correct information? """
 
-        smc = ServiceManagerContents(None , None)
+        smc = ServiceManagerContents(None , TestRequest())
         info = smc._extractContentInfo(('dummy', Dummy(),))
 
         self.assert_('IDummy' in info['interfaces'])
@@ -56,7 +60,7 @@
         dummy = Dummy()
         sm.setObject('dummy', dummy)
 
-        smc = ServiceManagerContents(sm, None)
+        smc = ServiceManagerContents(sm, TestRequest())
         info_list = smc.listContentInfo()
 
         self.assertEquals(len(info_list), 1)