[Checkins] SVN: zope.app.publisher/branches/3.4/ Fix bug: <browser:defaultView> now accepts classes as well as interfaces.

Philipp von Weitershausen philikon at philikon.de
Thu Aug 23 17:05:22 EDT 2007


Log message for revision 79176:
  Fix bug: <browser:defaultView> now accepts classes as well as interfaces.
  

Changed:
  U   zope.app.publisher/branches/3.4/CHANGES.txt
  U   zope.app.publisher/branches/3.4/src/zope/app/publisher/browser/metadirectives.py
  U   zope.app.publisher/branches/3.4/src/zope/app/publisher/browser/tests/test_directives.py

-=-
Modified: zope.app.publisher/branches/3.4/CHANGES.txt
===================================================================
--- zope.app.publisher/branches/3.4/CHANGES.txt	2007-08-23 21:04:29 UTC (rev 79175)
+++ zope.app.publisher/branches/3.4/CHANGES.txt	2007-08-23 21:05:22 UTC (rev 79176)
@@ -2,10 +2,14 @@
 Changes
 =======
 
+3.4.0b2 (2007-08-23)
+====================
 
-3.4.0b1
-=============
+- <browser:defaultView> now accepts classes as well as interfaces.
 
+3.4.0b1 (2007-08-21)
+====================
+
  - <browser:menuItem> can now be registered for classes (backport from 3.5)
 
  - Fixed a bug about xmlrpc:view: Omitting a permission was (widely)
@@ -13,7 +17,6 @@
    original security settings of the view class. This did not work at all and
    the permission was always required. It now works as described.
 
-
 Before 3.4
 ==========
 

Modified: zope.app.publisher/branches/3.4/src/zope/app/publisher/browser/metadirectives.py
===================================================================
--- zope.app.publisher/branches/3.4/src/zope/app/publisher/browser/metadirectives.py	2007-08-23 21:04:29 UTC (rev 79175)
+++ zope.app.publisher/branches/3.4/src/zope/app/publisher/browser/metadirectives.py	2007-08-23 21:05:22 UTC (rev 79176)
@@ -166,7 +166,7 @@
         required=True
         )
 
-    for_ = GlobalInterface(
+    for_ = GlobalObject(
         title=u"The interface this view is the default for.",
         description=u"""Specifies the interface for which the view is
         registered. All objects implementing this interface can make use of

Modified: zope.app.publisher/branches/3.4/src/zope/app/publisher/browser/tests/test_directives.py
===================================================================
--- zope.app.publisher/branches/3.4/src/zope/app/publisher/browser/tests/test_directives.py	2007-08-23 21:04:29 UTC (rev 79175)
+++ zope.app.publisher/branches/3.4/src/zope/app/publisher/browser/tests/test_directives.py	2007-08-23 21:05:22 UTC (rev 79176)
@@ -309,7 +309,25 @@
             zope.app.publisher.browser.getDefaultViewName(ob, request),
             'test')
 
+    def testDefaultViewForClass(self):
+        self.assertEqual(
+            component.queryMultiAdapter((ob, request), IDefaultViewName),
+            None)
 
+        xmlconfig(StringIO(template % (
+            '''
+            <browser:defaultView
+                for="zope.app.publisher.browser.tests.test_directives.Ob"
+                name="test"
+                />
+            '''
+            )))
+
+        self.assertEqual(
+            zope.app.publisher.browser.getDefaultViewName(ob, request),
+            'test')
+
+
     def testSkinResource(self):
         self.assertEqual(
             component.queryAdapter(Request(IV), name='test'), None)



More information about the Checkins mailing list