[z3-five] Integration tests with Five and ZCML
Martin Aspeli
optilude at gmx.net
Tue Jul 25 02:43:56 CEST 2006
Hi,
We've known for some time that it's Bad™ that PloneTestCase does:
ZopeTestCase.installProduct('Five')
I discovered that if I mix any tests using PloneTestCase (and this
statement, at module level) with any pure-Zope3 test that uses
zope.app.testing.placelesssetup.setUp (with or without a corresponding
.tearDown) I get strange and confusing errors even though the tests in
question run fine if the PloneTestCase tests are separated from the
Zope3-style ones.
Well, you told me so. But my question is, how *should* PloneTestCase be
behaving. Bear in mind that in this case we're really talking about
integration tests. We *want* PTC to load "all ZCML for all of Products/"
(or at least all other products registered with installProduct()). We'd
rather not require test authors to think about a dependency tree of ZCML
files and load them all. For unit tests that's good, but for integration
tests (which are sadly still the most prevalent and convenient in the
Zope2 world - too many objects to mock, too much reliance on things like
acquisition) we want to make sure the environment behaves as closely to
Zope2-on-startup as is reasonable.
We've been bemoaning this problem for a long time. I'd like to get it
out of the world once and for all. ;-)
Martin
More information about the z3-five
mailing list