Log message for revision 70513: Backport fix for #2168 (and dupe, 2203). Changed: U Products.Five/branches/1.5/CHANGES.txt U Products.Five/branches/1.5/metaconfigure.py U Products.Five/branches/1.5/tests/test_directives.py
-=- Modified: Products.Five/branches/1.5/CHANGES.txt =================================================================== --- Products.Five/branches/1.5/CHANGES.txt 2006-10-04 02:17:18 UTC (rev 70512) +++ Products.Five/branches/1.5/CHANGES.txt 2006-10-04 03:06:57 UTC (rev 70513) @@ -2,6 +2,11 @@ Five Changes ============ +Five 1.5.1 (unreleased) +===================== + +* Fixed #2168: Missing import + Five 1.5 (2006-08-13) ===================== Modified: Products.Five/branches/1.5/metaconfigure.py =================================================================== --- Products.Five/branches/1.5/metaconfigure.py 2006-10-04 02:17:18 UTC (rev 70512) +++ Products.Five/branches/1.5/metaconfigure.py 2006-10-04 03:06:57 UTC (rev 70513) @@ -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/branches/1.5/tests/test_directives.py =================================================================== --- Products.Five/branches/1.5/tests/test_directives.py 2006-10-04 02:17:18 UTC (rev 70512) +++ Products.Five/branches/1.5/tests/test_directives.py 2006-10-04 03:06:57 UTC (rev 70513) @@ -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