ImportError: No module named testing with z3c.form.testing imports
Question
Trying to run z3c.form.testing based code on Plone 4.1 and getting this exception
Traceback (most recent call last):
File "/home/xxx/DATA/projects/SVN_xxx_eggs/Products.xxxPatient/Products/xxxPatient/tests/test_views.py", line 13, in <module>
from z3c.form.testing import TestRequest
File "/home/xxx/DATA/projects/xxx_FOLDER/xxx_414/buildout-cache/eggs/z3c.form-2.5.1-py2.6.egg/z3c/form/testing.py", line 23, in <module>
from zope.app.testing import setup
ImportError: No module named testing
Do z3c.form needs special support or pindowns with Plone 4.1 to run unit tests? There might be need to refer testing modules in setup.py, but are there examples how to do this?
Solution
I think you have not a version issue here. It seems that your testrunner can't find the entire package zope.app.testing
so you just need to specify the extra_requires
keyword "test" (take a look here for z3c.form's extras_require) in your buildout like this:
[buildout]
eggs +=
z3c.form [test]
test-packages =
z3c.form
[test]
recipe = zc.recipe.testrunner
defaults = ['--auto-color', '--auto-progress']
eggs =
${buildout:eggs}
${buildout:test-packages}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow