[Zope3-checkins] CVS: Zope3/src/zope/app/presentation/tests - test_presentation.py:1.8

Jim Fulton jim at zope.com
Mon Mar 15 15:41:46 EST 2004


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

Modified Files:
	test_presentation.py 
Log Message:
Reworked to reflect changes in the adapter-registry api:

- Factory semantics are now provided by layers, rather than the
  underlying adapter registries

- Added multi-view support, but need more tests to finish.

- No longer expect multiple factories


=== Zope3/src/zope/app/presentation/tests/test_presentation.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/presentation/tests/test_presentation.py:1.7	Sat Mar 13 18:55:12 2004
+++ Zope3/src/zope/app/presentation/tests/test_presentation.py	Mon Mar 15 15:41:45 2004
@@ -15,6 +15,7 @@
 
 $Id$
 """
+
 from unittest import TestCase, TestSuite, main, makeSuite
 from zope.testing.doctestunit import DocTestSuite
 from zope.app.tests.placelesssetup import setUp, tearDown
@@ -196,7 +197,7 @@
             def __init__(self, x, y, request):
                 self.x, self.y, self.request = x, y, request
                 
-        globalService.provideAdapter(IBrowserRequest, [MV], 'foo.html',
+        globalService.provideAdapter(IBrowserRequest, MV, 'foo.html',
                                      contexts=(I1, I3))
         v = self._service.queryMultiView((x, y), 'foo.html', r)
         self.assertEqual(v.__class__, MV)
@@ -370,7 +371,7 @@
         self.assertEqual(registration.required, I1)
         self.assertEqual(registration.requestType, I2)
 
-        factory, = registration.factories
+        factory = registration.factory
         self.assertEqual(factory, A)
 
 
@@ -397,7 +398,7 @@
 
         c = C()
         request = TestRequest()
-        factory, = registration.factories
+        factory = registration.factory
         view = factory(c, request)
         self.assertEqual(view.__class__, BoundTemplate)
         self.assertEqual(removeAllProxies(view).template, self.__template)
@@ -417,7 +418,7 @@
             )
         c = C()
         request = TestRequest()
-        factory, = registration.factories
+        factory = registration.factory
         view = factory(c, request)
         self.assertEquals(view, A.run)
 
@@ -428,10 +429,10 @@
             )
         c = C()
         request = TestRequest()
-        self.assertRaises(ConfigurationError, lambda: registration.factories)
+        self.assertRaises(ConfigurationError, lambda: registration.factory)
         registration.template = '/++etc++site/default/t'
         registration.attribute = 'run'
-        self.assertRaises(ConfigurationError, lambda: registration.factories)
+        self.assertRaises(ConfigurationError, lambda: registration.factory)
 
     def test_addremoveNotify_template(self):
         ztapi.provideAdapter(ILocation, IPhysicallyLocatable,




More information about the Zope3-Checkins mailing list