[Zope-Checkins] SVN: Products.Five/trunk/ * Added tests to make sure that views are not blocked by acquired attributes.

Lennart Regebro cvs-admin at zope.org
Mon Jun 19 11:02:25 EDT 2006


Log message for revision 68752:
  * Added tests to make sure that views are not blocked by acquired attributes.
  
  * Changed the tests to reflect that defaultView no only works for views
    (and not on attributes).
  
  

Changed:
  U   Products.Five/trunk/CHANGES.txt
  U   Products.Five/trunk/browser/tests/test_defaultview.py
  U   Products.Five/trunk/browser/tests/test_traversable.py
  U   Products.Five/trunk/traversable.py

-=-
Modified: Products.Five/trunk/CHANGES.txt
===================================================================
--- Products.Five/trunk/CHANGES.txt	2006-06-19 14:51:45 UTC (rev 68751)
+++ Products.Five/trunk/CHANGES.txt	2006-06-19 15:02:21 UTC (rev 68752)
@@ -17,7 +17,12 @@
 * Added Five.browser.pagetemplatefile.ViewPageTemplateFile as an alias
   to ZopeTwoPageTemplateFile and as a Zope 2 correspondence to
   zope.app.pagetemplate.ViewPageTemplateFile.
+  
+* Added tests to make sure that views are not blocked by acquired attributes.
 
+* Changed the tests to reflect that defaultView no only works for views
+  (and not on attributes).
+
 Five 1.5c (2006-05-29)
 ======================
 

Modified: Products.Five/trunk/browser/tests/test_defaultview.py
===================================================================
--- Products.Five/trunk/browser/tests/test_defaultview.py	2006-06-19 14:51:45 UTC (rev 68751)
+++ Products.Five/trunk/browser/tests/test_defaultview.py	2006-06-19 15:02:21 UTC (rev 68752)
@@ -88,15 +88,14 @@
       ...
       The mouse has been eaten by the eagle
 
-    This tests whether an existing ``index_html`` method is still
-    supported and called:
-
+    In Five 1.5 ``index_html`` you can no longer set default views to anything
+    else than views:
+    
       >>> print http(r'''
       ... GET /test_folder_1_/testindex HTTP/1.1
       ... ''')
-      HTTP/1.1 200 OK
+      HTTP/1.1 404 Not Found
       ...
-      Default index_html called
 
     Disabled __call__ overriding for now.  Causes more trouble than it
     fixes.  Thus, no test here:

Modified: Products.Five/trunk/browser/tests/test_traversable.py
===================================================================
--- Products.Five/trunk/browser/tests/test_traversable.py	2006-06-19 14:51:45 UTC (rev 68751)
+++ Products.Five/trunk/browser/tests/test_traversable.py	2006-06-19 15:02:21 UTC (rev 68752)
@@ -206,6 +206,13 @@
       ...       attribute="eagle"
       ...       permission="zope2.Public"
       ...       />
+      ...   <browser:page
+      ...       name="mouse"
+      ...       for="OFS.interfaces.IObjectManager"
+      ...       class="Products.Five.browser.tests.pages.SimpleView"
+      ...       attribute="mouse"
+      ...       permission="zope2.Public"
+      ...       />
       ... </configure>'''
       >>> import Products.Five
       >>> from Products.Five import zcml
@@ -262,6 +269,17 @@
       ...
       The eagle has landed
 
+    However, acquired attributes *should* be shadowed. See discussion on
+    http://codespeak.net/pipermail/z3-five/2006q2/001474.html
+    
+      >>> manage_addIndexSimpleContent(self.folder, 'mouse', 'Mouse')
+      >>> print http(r'''
+      ... GET /test_folder_1_/ftf/mouse HTTP/1.1
+      ... ''')
+      HTTP/1.1 200 OK
+      ...
+      The mouse has been eaten by the eagle
+      
     Clean up:
 
       >>> from zope.app.testing.placelesssetup import tearDown

Modified: Products.Five/trunk/traversable.py
===================================================================
--- Products.Five/trunk/traversable.py	2006-06-19 14:51:45 UTC (rev 68751)
+++ Products.Five/trunk/traversable.py	2006-06-19 15:02:21 UTC (rev 68752)
@@ -22,8 +22,8 @@
     "__bobo_traverse__ and ITraverser/ITraversable for controlling "
     "URL traversal have become obsolete. Use an IPublishTraverse "
     "adapter instead.  This reference will go away in Zope 2.12.",
-    Traversable = "Products.Five.bbb.Traversable",
-    FiveTraversable = "zope.traversing.adapters.DefaultTraversable",
+    Traversable = "Products.Five.bbb:Traversable",
+    FiveTraversable = "zope.traversing.adapters:DefaultTraversable",
     )
 zope.deferredimport.deprecated(
     "Use zope.publisher.browser.TestRequest instead.",



More information about the Zope-Checkins mailing list