[Zope3-checkins] CVS: Zope3/src/zope/app/presentation/tests -
test_presentation.py:1.12
Jim Fulton
jim at zope.com
Fri Apr 9 07:36:44 EDT 2004
Update of /cvs-repository/Zope3/src/zope/app/presentation/tests
In directory cvs.zope.org:/tmp/cvs-serv12965/src/zope/app/presentation/tests
Modified Files:
test_presentation.py
Log Message:
Implemented the registrations method for the presentation services.
=== Zope3/src/zope/app/presentation/tests/test_presentation.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/presentation/tests/test_presentation.py:1.11 Wed Mar 31 18:26:24 2004
+++ Zope3/src/zope/app/presentation/tests/test_presentation.py Fri Apr 9 07:36:13 2004
@@ -91,6 +91,9 @@
def activated(self): pass
def deactivated(self): pass
+ def __repr__(self):
+ return 'Registration(%s)' % self.factory.__name__
+
class C: pass
class PhonyTemplate:
@@ -291,6 +294,25 @@
self.assertEqual(view.__class__, A2)
self.assertEqual(view.context, o)
self.assertEqual(view.request, request)
+
+ def test_registrations(self):
+ self.test_queryView()
+ registrations = map(str, self._service.registrations())
+ registrations.sort()
+ self.assertEqual(
+ registrations,
+
+ ['Registration(A)',
+
+ # These were set up by PlacefulSetup:
+ "zope.component.presentation.PresentationRegistration("
+ "default, ('IContainmentRoot', 'IBrowserRequest'), "
+ "'Interface', 'absolute_url', 'SiteAbsoluteURL', '')",
+ "zope.component.presentation.PresentationRegistration("
+ "default, (None, 'IBrowserRequest'), 'Interface', "
+ "'absolute_url', 'AbsoluteURL', '')"
+ ]
+ )
def test_getRegistrationsForInterface(self):
self.test_queryView()
More information about the Zope3-Checkins
mailing list