[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services/tests - test_rolecontents.py:1.7

Jim Fulton jim at zope.com
Sun Sep 21 13:31:06 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/browser/services/tests
In directory cvs.zope.org:/tmp/cvs-serv12692/src/zope/app/browser/services/tests

Modified Files:
	test_rolecontents.py 
Log Message:
Use the rootFolder helper rather than the RootFolder class.

Added additional user setup now needed by contents view.

Don't use context wrappers.


=== Zope3/src/zope/app/browser/services/tests/test_rolecontents.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/browser/services/tests/test_rolecontents.py:1.6	Sun Aug 17 02:05:57 2003
+++ Zope3/src/zope/app/browser/services/tests/test_rolecontents.py	Sun Sep 21 13:31:05 2003
@@ -22,7 +22,9 @@
 from zope.app.browser.services.role import Contents
 from zope.app.services.role import RoleService
 from zope.app.browser.container.tests.test_contents \
-     import BaseTestContentsBrowserView
+     import BaseTestContentsBrowserView, Principal
+from zope.app.content.folder import rootFolder
+from zope.app.container.contained import contained
 
 class IDummy(Interface):
     pass
@@ -33,15 +35,15 @@
 class Test(BaseTestContentsBrowserView, unittest.TestCase):
 
     def _TestView__newContext(self):
-        from zope.app.content.folder import RootFolder
-        from zope.app.context import ContextWrapper
-        root = RootFolder()
+        root = rootFolder()
         container = RoleService()
-        return ContextWrapper(container, root, name='sample')
+        return contained(container, root, name='sample')
 
     def _TestView__newView(self, container):
         from zope.publisher.browser import TestRequest
-        return Contents(container, TestRequest())
+        request = TestRequest()
+        request.setUser(Principal())
+        return Contents(container, request)
 
 def test_suite():
     loader = unittest.TestLoader()




More information about the Zope3-Checkins mailing list