Chris Withers wrote:
> Now, related to this, say I have content objects X and Y, which are 
> expensive to set up. I have LayerX which sets up a sample content object 
> X, and LayerY which does the same for content object Y. This is fine for 
> tests which need one or other content type, but how do I write tests 
> which need both?

Layers are ... layered. If your test base class has layer X and a test case
subclass of that has layer Y, then it will set up X, run all the X tests,
then setup Y and run all the Y and X&Y tests, then tear down Y and then X.

I did this in Plone recently, but it completely escapes me where. Maybe I'll
have an epiphany after lunch, but look at how the ZCML layer in
PloneTestCase trunk works (it sets up all kinds of ZCML) and then try to
derive a class from PloneTestCase (or your equivalent) and set layer =


View this message in context:
Sent from the Zope3 - dev mailing list archive at

Zope3-dev mailing list

Reply via email to