[Zope3-checkins] CVS: Zope3/src/zope/component/tests - test_presentation.py:1.5

Jim Fulton jim at zope.com
Fri Apr 9 07:36:15 EDT 2004


Update of /cvs-repository/Zope3/src/zope/component/tests
In directory cvs.zope.org:/tmp/cvs-serv12965/src/zope/component/tests

Modified Files:
	test_presentation.py 
Log Message:
Implemented the registrations method for the presentation services.


=== Zope3/src/zope/component/tests/test_presentation.py 1.4 => 1.5 ===
--- Zope3/src/zope/component/tests/test_presentation.py:1.4	Wed Mar 31 18:26:26 2004
+++ Zope3/src/zope/component/tests/test_presentation.py	Fri Apr  9 07:36:14 2004
@@ -86,7 +86,8 @@
     >>> request = Request()
 
     >>> s.provideAdapter(IRequest, ContactInCompanyView,
-    ...                  contexts=[IContact, ICompany], name='foo')
+    ...                  contexts=[IContact, ICompany], name='foo',
+    ...                  info='test 1')
 
     >>> bob = Contact()
     >>> acme = Company()
@@ -102,7 +103,8 @@
     True
 
     >>> s.provideAdapter(IRequest, ContactInFamilyView,
-    ...                  contexts=[IContact, IFamily], name='foo')
+    ...                  contexts=[IContact, IFamily], name='foo',
+    ...                  info='test 2')
     
     >>> smith = Family()
     >>> v = s.queryMultiView((bob, smith), request, name='foo')
@@ -114,6 +116,19 @@
     True
     >>> v.request is request
     True
+
+    Provided adapters (views and resources) are recorded as registrations:
+
+    >>> registrations = map(str, s.registrations())
+    >>> registrations.sort()
+    >>> for r in registrations:
+    ...     print r
+    zope.component.presentation.PresentationRegistration(""" \
+       """default, ('IContact', 'ICompany', 'IRequest'), """ \
+       """'Interface', 'foo', 'ContactInCompanyView', 'test 1')
+    zope.component.presentation.PresentationRegistration(""" \
+       """default, ('IContact', 'IFamily', 'IRequest'), """ \
+       """'Interface', 'foo', 'ContactInFamilyView', 'test 2')
     
     """
 




More information about the Zope3-Checkins mailing list