Log message for revision 69765:
   Fixed #2168: Missing import
  
  

Changed:
  U   Products.Five/trunk/CHANGES.txt
  U   Products.Five/trunk/metaconfigure.py
  U   Products.Five/trunk/tests/test_directives.py

-=-
Modified: Products.Five/trunk/CHANGES.txt
===================================================================
--- Products.Five/trunk/CHANGES.txt     2006-08-24 14:26:52 UTC (rev 69764)
+++ Products.Five/trunk/CHANGES.txt     2006-08-24 14:39:34 UTC (rev 69765)
@@ -2,6 +2,11 @@
 Five Changes
 ============
 
+Five 1.5.1 (unreleased)
+=====================
+
+* Fixed #2168: Missing import
+
 Five 1.5 (2006-08-13)
 =====================
 

Modified: Products.Five/trunk/metaconfigure.py
===================================================================
--- Products.Five/trunk/metaconfigure.py        2006-08-24 14:26:52 UTC (rev 
69764)
+++ Products.Five/trunk/metaconfigure.py        2006-08-24 14:39:34 UTC (rev 
69765)
@@ -15,6 +15,7 @@
 
 $Id$
 """
+import warnings
 from zope.configuration.exceptions import ConfigurationError
 from zope.app.component import contentdirective
 from Products.Five.security import protectName, initializeClass

Modified: Products.Five/trunk/tests/test_directives.py
===================================================================
--- Products.Five/trunk/tests/test_directives.py        2006-08-24 14:26:52 UTC 
(rev 69764)
+++ Products.Five/trunk/tests/test_directives.py        2006-08-24 14:39:34 UTC 
(rev 69765)
@@ -73,6 +73,51 @@
       >>> cleanUp()
     """
 
+def test_content_deprecation():
+    """
+    Test deprecated content directive
+
+    There was a bug in the content directive deprecation code
+    which caused all code that use this directive break.
+    So we test this to make sure it works. If the content
+    directive will have been removed, this test can be removed
+    entirely as well.
+
+    First, we load the configuration file:
+
+      >>> import Products.Five.tests
+      >>> from Products.Five import zcml
+      >>> zcml.load_config('meta.zcml', Products.Five)
+      >>> zcml.load_config('directives.zcml', Products.Five.tests)
+
+    Use the <content> directives: this gives a deprecation
+    warning but should otherwise be all right. (We embed the block
+    to suppress the deprecation warning...)
+
+      >>> import warnings
+      >>> warnings.showwarning, _savewarning = lambda *args, **kw: None, 
warnings.showwarning
+      >>> zcml.load_string('''
+      ...   <configure xmlns="http://namespaces.zope.org/zope";>
+      ...      <content class="Products.Five.tests.classes.One">
+      ...          <implements interface="Products.Five.tests.classes.IOne" />
+      ...      </content>
+      ...   </configure>
+      ...   ''')
+
+    Check that they are all right.
+
+      >>> from Products.Five.tests.classes import One, Two, IOne, ITwo
+      >>> IOne.implementedBy(One)
+      True
+
+    Clean up adapter registry and others:
+
+      >>> warnings.showwarning  = _savewarning
+      >>> from zope.testing.cleanup import cleanUp
+      >>> cleanUp()
+    """
+
+
 def test_suite():
     from Testing.ZopeTestCase import ZopeDocTestSuite
     return ZopeDocTestSuite()

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

Reply via email to