[Zope-Checkins]
SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy
Make sure that those old aq_* attributes work on browser
views that only inherit
Philipp von Weitershausen
philikon at philikon.de
Sat Sep 1 16:59:12 EDT 2007
Log message for revision 79431:
Make sure that those old aq_* attributes work on browser views that only inherit
from Explicit as well.
Changed:
U Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py
U Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.zcml
U Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py 2007-09-01 20:25:48 UTC (rev 79430)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py 2007-09-01 20:59:12 UTC (rev 79431)
@@ -32,6 +32,13 @@
def __call__(self):
return repr([obj for obj in self.aq_chain])
+class ExplicitLegacyAttributes(Acquisition.Explicit):
+ """Make sure that those old aq_* attributes work on browser views
+ that only inherit from Explicit as well."""
+
+ def __call__(self):
+ return repr([obj for obj in self.aq_chain])
+
class LegacyTemplate(BrowserView):
template = ViewPageTemplateFile('falcon.pt')
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.zcml
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.zcml 2007-09-01 20:25:48 UTC (rev 79430)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.zcml 2007-09-01 20:59:12 UTC (rev 79431)
@@ -10,6 +10,13 @@
<browser:page
for="*"
+ name="explicitattributes"
+ class=".aqlegacy.ExplicitLegacyAttributes"
+ permission="zope.Public"
+ />
+
+ <browser:page
+ for="*"
name="template"
class=".aqlegacy.LegacyTemplate"
permission="zope.Public"
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
===================================================================
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt 2007-09-01 20:25:48 UTC (rev 79430)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt 2007-09-01 20:59:12 UTC (rev 79431)
@@ -26,6 +26,15 @@
<Application at >,
<ZPublisher.BaseRequest.RequestContainer object at ...>]
+The same goes for browser views that just mix in Acquisition.Explicit:
+
+ >>> browser.open('http://localhost/test_folder_1_/explicitattributes')
+ >>> print browser.contents
+ [<Products.Five.metaclass.ExplicitLegacyAttributes object at ...>,
+ <Folder at /test_folder_1_>,
+ <Application at >,
+ <ZPublisher.BaseRequest.RequestContainer object at ...>]
+
Let's do some more manual tests with the view object. But first we
must get it:
More information about the Zope-Checkins
mailing list