[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Products/Five/ Merge a couple of fixes that are related to http://www.zope.org/Collectors/Zope/1947

Philipp von Weitershausen philikon at philikon.de
Tue Dec 20 08:02:11 EST 2005


Log message for revision 40898:
  Merge a couple of fixes that are related to http://www.zope.org/Collectors/Zope/1947
  and http://mail.zope.org/pipermail/zope-dev/2005-December/026236.html from the Five
  repository:
  
  Log message for r21321:
    Explain what this test does and fix misleading and risky usage of pprint
  
  Log message for r21322:
    Fix this test and re-enable it
  
  Log message for r21325:
    Add changes entry for some recently fixed bug
    update Five 1.2 changes history
    bump version number after 1.3c "release"
  

Changed:
  U   Zope/branches/2.9/lib/python/Products/Five/CHANGES.txt
  U   Zope/branches/2.9/lib/python/Products/Five/site/tests/functional.txt
  U   Zope/branches/2.9/lib/python/Products/Five/site/tests/test_functional.py
  U   Zope/branches/2.9/lib/python/Products/Five/version.txt

-=-
Modified: Zope/branches/2.9/lib/python/Products/Five/CHANGES.txt
===================================================================
--- Zope/branches/2.9/lib/python/Products/Five/CHANGES.txt	2005-12-20 11:40:21 UTC (rev 40897)
+++ Zope/branches/2.9/lib/python/Products/Five/CHANGES.txt	2005-12-20 13:02:11 UTC (rev 40898)
@@ -2,6 +2,15 @@
 Five Changes
 ============
 
+Five 1.3 (unreleased)
+=====================
+
+Bugfixes
+--------
+
+* Fix functional test for local sites and re-enable it for standard
+  test runs.
+
 Five 1.3c (2005-12-06)
 ======================
 
@@ -75,11 +84,15 @@
 
 * Fixed loops in zcml loading due to events in some cases.
 
+* Made Five send a ContainerModifiedEvent when appropriate.
+
 Restructuring
 -------------
 
 * Cleaned up security test.
 
+* Added monkey so that ++skin++ works with Zope <= 2.8.4.
+
 Five 1.2b (2005-11-02)
 ======================
 

Modified: Zope/branches/2.9/lib/python/Products/Five/site/tests/functional.txt
===================================================================
--- Zope/branches/2.9/lib/python/Products/Five/site/tests/functional.txt	2005-12-20 11:40:21 UTC (rev 40897)
+++ Zope/branches/2.9/lib/python/Products/Five/site/tests/functional.txt	2005-12-20 13:02:11 UTC (rev 40898)
@@ -1,13 +1,25 @@
 Functional test for local sites
 ===============================
 
-Set up all of Five:
+This tests how local site managers are found during traversal and how
+that affects component lookup (depending on whether a site is
+traversed or not, local components might or might not be found).
 
+First, we set up all of Five:
+
   >>> import Products.Five
   >>> from Products.Five import zcml
   >>> zcml.load_config("configure.zcml", Products.Five)
 
-First we turn our DummySite class into a site in ZCML (and register
+Then we hook up the custom component architecture calls; we need to do
+this here because zope.app.component.hooks registers a cleanup with
+the testing cleanup framework, so the hooks get torn down by
+placelesssetup each time.
+
+  >>> from zope.app.component.hooks import setHooks
+  >>> setHooks()
+
+Next we turn our DummySite class into a site in ZCML (and register
 some views that will provide us with some test info),
 
   >>> zcml_text = """
@@ -50,9 +62,9 @@
   ... ''')
   HTTP/1.1 200 OK
   ...
-  {'IFiveUtilityRegistry.providedBy(utility_service)': False,
-   'isinstance(zapi.getSiteManager(), FiveSiteManager)': False,
-   'zapi.getSiteManager() is zapi.getGlobalSiteManager()': True}
+  zapi.getSiteManager() is zapi.getGlobalSiteManager(): True
+  IFiveUtilityRegistry.providedBy(utility_service): False
+  isinstance(zapi.getSiteManager(), FiveSiteManager): False
 
 We see that we have no local component lookup yet, because we haven't
 set the site.  Therefore, enable the traversal hook by using the view
@@ -79,9 +91,9 @@
   ... ''')
   HTTP/1.1 200 OK
   ...
-  {'IFiveUtilityRegistry.providedBy(utility_service)': True,
-   'isinstance(zapi.getSiteManager(), FiveSiteManager)': True,
-   'zapi.getSiteManager() is zapi.getGlobalSiteManager()': False}
+  zapi.getSiteManager() is zapi.getGlobalSiteManager(): False
+  IFiveUtilityRegistry.providedBy(utility_service): True
+  isinstance(zapi.getSiteManager(), FiveSiteManager): True
 
 Of course, sites are only active *during* traversal; after traversal
 they're gone:
@@ -137,9 +149,9 @@
   ... ''')
   HTTP/1.1 200 OK
   ...
-  {'IFiveUtilityRegistry.providedBy(utility_service)': False,
-   'isinstance(zapi.getSiteManager(), FiveSiteManager)': False,
-   'zapi.getSiteManager() is zapi.getGlobalSiteManager()': True}
+  zapi.getSiteManager() is zapi.getGlobalSiteManager(): True
+  IFiveUtilityRegistry.providedBy(utility_service): False
+  isinstance(zapi.getSiteManager(), FiveSiteManager): False
 
 Finally, global services and the monkeys:
 

Modified: Zope/branches/2.9/lib/python/Products/Five/site/tests/test_functional.py
===================================================================
--- Zope/branches/2.9/lib/python/Products/Five/site/tests/test_functional.py	2005-12-20 11:40:21 UTC (rev 40897)
+++ Zope/branches/2.9/lib/python/Products/Five/site/tests/test_functional.py	2005-12-20 13:02:11 UTC (rev 40898)
@@ -31,15 +31,13 @@
 
     def __call__(self):
         sm = zapi.getSiteManager()
-        result = {
-            'zapi.getSiteManager() is zapi.getGlobalSiteManager()':
-            sm is zapi.getGlobalSiteManager(),
-            'IFiveUtilityRegistry.providedBy(utility_service)':
-            IFiveUtilityRegistry.providedBy(sm.utilities),
-            'isinstance(zapi.getSiteManager(), FiveSiteManager)':
-            isinstance(sm, FiveSiteManager),
-            }
-        return pprint.pformat(result)
+        result = ('zapi.getSiteManager() is zapi.getGlobalSiteManager(): %s\n'
+                  'IFiveUtilityRegistry.providedBy(utility_service): %s\n'
+                  'isinstance(zapi.getSiteManager(), FiveSiteManager): %s'
+                  % (sm is zapi.getGlobalSiteManager(),
+                     IFiveUtilityRegistry.providedBy(sm.utilities),
+                     isinstance(sm, FiveSiteManager)))
+        return result
 
 class LookupUtilitiesView(BrowserView):
 
@@ -50,10 +48,8 @@
 
 def test_suite():
     from Testing.ZopeTestCase import FunctionalDocFileSuite
-    suite = FunctionalDocFileSuite('functional.txt',
-                                   package='Products.Five.site.tests')
-    suite.level = 2
-    return suite
+    return FunctionalDocFileSuite('functional.txt',
+                                  package='Products.Five.site.tests')
 
 if __name__ == '__main__':
     framework()

Modified: Zope/branches/2.9/lib/python/Products/Five/version.txt
===================================================================
--- Zope/branches/2.9/lib/python/Products/Five/version.txt	2005-12-20 11:40:21 UTC (rev 40897)
+++ Zope/branches/2.9/lib/python/Products/Five/version.txt	2005-12-20 13:02:11 UTC (rev 40898)
@@ -1 +1 @@
-Five 1.3c
+Five 1.3



More information about the Zope-Checkins mailing list