Note that there are some explanatory texts on larger screens.

plurals
  1. POImportError using plone.app.testing
    text
    copied!<p>I'm currently working through Professional Plone 4 Development while using the unified installer for 4.1.2. I'm not sure if using the installer over the explicit buildout process in the book is causing issues but I'm having a lot of trouble tying up the examples with the actuality of what is installed. Right now, I'm having an issue with running tests for the policy package I'm creating.</p> <p>In the package's <strong>setup.py</strong>, I have:</p> <pre><code>extras_require={ 'test': ['plone.app.testing',] }, </code></pre> <p>In <strong>develop.cfg</strong>:</p> <pre><code>[buildout] parts += test [test] recipe = zc.recipe.testrunner defaults = ['--auto-color', '--auto-progress'] </code></pre> <p>And finally, <strong>testing.py</strong> imports:</p> <pre><code>from plone.app.testing import ( PloneSandboxLayer, applyProfile, PLONE_FIXTURE, IntegrationTesting, ) </code></pre> <p>After running buildout using the develop configuration, the test runner is installed as expected to bin/test. But trying to run the tests for that package gives me the following:</p> <pre><code>$ bin/test -s ctcc.policy bin/test:239: DeprecationWarning: zope.testing.testrunner is deprecated in favour of zope.testrunner. /opt/plone41/buildout-cache/eggs/zope.testing-3.9.6-py2.6.egg/zope/testing/testrunner/formatter.py:28: DeprecationWarning: zope.testing.exceptions is deprecated in favour of zope.testrunner.exceptions from zope.testing.exceptions import DocTestFailureException Test-module import failures: Module: ctcc.policy.tests Traceback (most recent call last): File "/opt/plone41/zeocluster/src/ctcc.policy/ctcc/policy/tests.py", line 2, in &lt;module&gt; from ctcc.policy.testing import CTCC_POLICY_INTEGRATION_TESTING File "/opt/plone41/zeocluster/src/ctcc.policy/ctcc/policy/testing.py", line 1, in &lt;module&gt; from plone.app.testing import ( ImportError: No module named testing </code></pre> <p>What do I need to do to be able to use plone.app.testing?</p> <p>If the issue is due to it using zope.testing.testrunner over zope.testrunner, where exactly is this specified? I can't find a reference to it in any of the buildout configs.</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload