我正在为zeocluster/src/...
安装目录中的 Plone 4 开发产品,并且我有一个自动化测试。不幸的是,当我运行 'bin/client1 shell' 然后(path to Plone's Python)/bin/python setup.py test
,它失败了。错误是
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')