インストールのzeocluster/src/...
ディレクトリ内のPlone 4用の製品を開発しています。私は自動テストを行っています。残念ながら、私が 'bin/client1 shell'を実行してから(path to Plone's Python)/bin/python setup.py test
を実行すると失敗します。エラーはPlone 4で開発中の製品でテストを実行するにはどうすればよいですか?
File "buildout-cache/eggs/Products.PloneTestCase-0.9.12-py2.6.egg/Products/PloneTestCase/PloneTestCase.py", line 109, in getPortal
return getattr(self.app, portal_name)
AttributeError: plone
Plone 4で自動テストを実行する正しい方法は何ですか?
setup.py
において
、
...
test_suite = "nose.collector"
...
失敗試験:
import unittest
from Products.PloneTestCase import PloneTestCase as ptc
ptc.setupPloneSite()
class NullTest(ptc.PloneTestCase):
def testTest(self):
pass
def test_suite():
return unittest.TestSuite([
unittest.makeSuite(NullTest)
])
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
統合インストーラを使用してインストールした場合は、 "bin/buildout -c develop.cfg"を実行してbin/testおよびその他の開発指向ツールを入手します。 develop.cfgを編集してオプションをカスタマイズします。 – SteveM