Log message for revision 73770:
  Merge Collector #2264 fix from Zope trunk: browser:view should set __name__

Changed:
  U   Products.Five/branches/1.4/browser/metaconfigure.py
  U   Products.Five/branches/1.4/browser/tests/pages.txt
  U   Products.Five/branches/1.4/browser/tests/pages.zcml

-=-
Modified: Products.Five/branches/1.4/browser/metaconfigure.py
===================================================================
--- Products.Five/branches/1.4/browser/metaconfigure.py 2007-03-27 15:01:20 UTC 
(rev 73769)
+++ Products.Five/branches/1.4/browser/metaconfigure.py 2007-03-27 15:03:46 UTC 
(rev 73770)
@@ -247,6 +247,7 @@
         except:
             cname = "GeneratedClass"
             
+        cdict['__name__'] = name
         newclass = makeClass(cname, bases, cdict)
         
         _handle_for(_context, for_)

Modified: Products.Five/branches/1.4/browser/tests/pages.txt
===================================================================
--- Products.Five/branches/1.4/browser/tests/pages.txt  2007-03-27 15:01:20 UTC 
(rev 73769)
+++ Products.Five/branches/1.4/browser/tests/pages.txt  2007-03-27 15:03:46 UTC 
(rev 73770)
@@ -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.4/browser/tests/pages.zcml
===================================================================
--- Products.Five/branches/1.4/browser/tests/pages.zcml 2007-03-27 15:01:20 UTC 
(rev 73769)
+++ Products.Five/branches/1.4/browser/tests/pages.zcml 2007-03-27 15:03:46 UTC 
(rev 73770)
@@ -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 -->

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to