[Zope-Checkins] SVN: Products.Five/branches/1.5/browser/ Merge
Collector #2264 fix from Zope trunk: browser:view should set
__name__
Martijn Pieters
mj at zopatista.com
Tue Mar 27 10:58:44 EDT 2007
Log message for revision 73767:
Merge Collector #2264 fix from Zope trunk: browser:view should set __name__
Changed:
U Products.Five/branches/1.5/browser/metaconfigure.py
U Products.Five/branches/1.5/browser/tests/pages.txt
U Products.Five/branches/1.5/browser/tests/pages.zcml
-=-
Modified: Products.Five/branches/1.5/browser/metaconfigure.py
===================================================================
--- Products.Five/branches/1.5/browser/metaconfigure.py 2007-03-27 14:57:27 UTC (rev 73766)
+++ Products.Five/branches/1.5/browser/metaconfigure.py 2007-03-27 14:58:44 UTC (rev 73767)
@@ -251,6 +251,7 @@
except:
cname = "GeneratedClass"
+ cdict['__name__'] = name
newclass = makeClass(cname, bases, cdict)
_handle_for(_context, for_)
Modified: Products.Five/branches/1.5/browser/tests/pages.txt
===================================================================
--- Products.Five/branches/1.5/browser/tests/pages.txt 2007-03-27 14:57:27 UTC (rev 73766)
+++ Products.Five/branches/1.5/browser/tests/pages.txt 2007-03-27 14:58:44 UTC (rev 73767)
@@ -85,8 +85,18 @@
>>> self.folder.unrestrictedTraverse('testoid/@@new_style_class2')
<Products.Five.metaclass.NewStyleClass ...>
+
+Both browser:view and browser:page are ILocation providers, so make sure they
+have a __name__ attribute:
+ >>> page = self.folder.unrestrictedTraverse('testoid/eagle.txt')
+ >>> page.__name__
+ u'eagle.txt'
+ >>> view = self.folder.unrestrictedTraverse('testoid/named_view')
+ >>> view.__name__
+ u'named_view'
+
ZPT-based browser pages
-----------------------
Modified: Products.Five/branches/1.5/browser/tests/pages.zcml
===================================================================
--- Products.Five/branches/1.5/browser/tests/pages.zcml 2007-03-27 14:57:27 UTC (rev 73766)
+++ Products.Five/branches/1.5/browser/tests/pages.zcml 2007-03-27 14:58:44 UTC (rev 73767)
@@ -218,6 +218,14 @@
permission="zope2.Public"
/>
+ <!-- A named view -->
+ <browser:view
+ name="named_view"
+ for="Products.Five.tests.testing.simplecontent.ISimpleContent"
+ class=".pages.SimpleView"
+ permission="zope2.Public"
+ />
+
<!-- XXX this should really be in Five.form.tests -->
<!-- protected edit form for permission check -->
More information about the Zope-Checkins
mailing list