grokproject generate a wrong ftesting.zcml with Grok 0.12
Here is the error log while trying to make some basic functional testing
./bin/test
Running tests at level 1
Running unit tests:
Running:
..
Ran 2 tests with 0 failures and 0 errors in 0.005 seconds.
Running sample.testing.FunctionalLayer tests:
Set up sample.testing.FunctionalLayer Traceback (most recent call last):
File "/home/sancho/grok/eggs/tmpH0BX7D/zope.testing-3.5.1-py2.4.egg/zope/testing/testrunner.py", line 1252, in run_layer
File "/home/sancho/grok/eggs/tmpH0BX7D/zope.testing-3.5.1-py2.4.egg/zope/testing/testrunner.py", line 1377, in setup_layer
File "/home/sancho/grok/eggs/tmpFAB7tb/zope.app.testing-3.4.0a1-py2.4.egg/zope/app/testing/functional.py", line 196, in setUp
File "/home/sancho/grok/eggs/tmpFAB7tb/zope.app.testing-3.4.0a1-py2.4.egg/zope/app/testing/functional.py", line 129, in __init__
File "/home/sancho/grok/eggs/tmphT5Sxo/zope.app.debug-3.4.0a1-py2.4.egg/zope/app/debug/debug.py", line 36, in __init__
File "/home/sancho/grok/eggs/zope.app.appsetup-3.4.1-py2.4.egg/zope/app/appsetup/appsetup.py", line 111, in config
context = xmlconfig.file(file, context=context, execute=execute)
File "/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py", line 610, in file
File "/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py", line 546, in include
File "/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py", line 378, in processxmlfile
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 216, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py", line 364, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py", line 357, in endElementNS
File "/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py", line 542, in end
File "/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py", line 689, in finish
File "/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py", line 1381, in toargs
File "/home/sancho/grok/eggs/tmplKkn8j/zope.configuration-3.4.0-py2.4.egg/zope/configuration/fields.py", line 141, in fromUnicode
ZopeXMLConfigurationError: File "/home/sancho/grok/Sample/src/sample/ftesting.zcml", line 11.2-13.8
ConfigurationError: ('Invalid value for', 'component', "ImportError: Couldn't import zope.app.securitypolicy.zopepolicy, No module named securitypolicy.zopepolicy")
Tests with errors:
runTest (zope.testing.testrunner.SetUpLayerFailure)
Total: 2 tests, 0 failures, 1 errors in 2.404 seconds.
modifying ftesting.zcml
from:
<securityPolicy
component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy"
/>
to:
<securityPolicy
component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
/>
it works fine.
We could just use the correct package (zope.securityp olicy.zopepolic y.ZopeSecurityP olicy) in grokproject instead of the one used by Grok <= 0.11.1 (zope.app. securitypolicy. zopepolicy. ZopeSecurityPol icy).
Are there any objections? Otherwise I would check this patch into the grokproject trunk shortly.