[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_view.py:1.3

Jim Fulton jim@zope.com
Tue, 21 Jan 2003 16:45:12 -0500


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

Modified Files:
	test_view.py 
Log Message:
Added permission to the schema for TTW view and page configurations.
Updated pages to use the permisssion.

Changed TTW views and pages to use "class" rather than "factory",
where a class is just a mix-in class. It need not provide a standard
__init__ or mix in BrowserView.

Made it possible to change the class.

Removed the presentation type from page configurations. The
persentation type is always IBrowserPresentation.



=== Zope3/src/zope/app/services/tests/test_view.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/tests/test_view.py:1.2	Wed Dec 25 09:13:20 2002
+++ Zope3/src/zope/app/services/tests/test_view.py	Tue Jan 21 16:45:09 2003
@@ -36,7 +36,7 @@
 from zope.app.services.view import PageConfiguration, BoundTemplate
 from zope.interface.verify import verifyObject
 from zope.component.interfaces import IViewService
-
+from zope.proxy.introspection import removeAllProxies
 class I1(Interface):
     pass
 
@@ -199,7 +199,8 @@
         rootFolder = RootFolder()
         rootFolder.setServiceManager(PhonyServiceManager())
         self.configuration = ContextWrapper(
-            ViewConfiguration(I1, 'test', IBrowserPresentation, "Foo.Bar.A"),
+            ViewConfiguration(I1, 'test', IBrowserPresentation, "Foo.Bar.A",
+                              'zope.View'),
             rootFolder,
             )
 
@@ -227,7 +228,7 @@
         self.__template = PhonyTemplate()
         default.setObject('t', self.__template)
         self.__configuration = ContextWrapper(
-            PageConfiguration(I1, 'test', IBrowserPresentation,
+            PageConfiguration(I1, 'test', 'zope.View',
                               "Foo.Bar.A",
                               '/++etc++Services/Packages/default/t',
                               ),
@@ -239,10 +240,10 @@
         request = TestRequest()
         view = self.__configuration.getView(c, request)
         self.assertEqual(view.__class__, BoundTemplate)
-        self.assertEqual(view.template, self.__template)
+        self.assertEqual(removeAllProxies(view).template, self.__template)
 
-        view = view.view
-        self.assertEqual(view.__class__, A)
+        view = removeAllProxies(view).view
+        self.assert_(issubclass(view.__class__, A))
         self.assertEqual(view.context, c)
         self.assertEqual(view.request, request)
         self.assertEqual(self.__configuration.forInterface, I1)