[Zope-CMF] Re: Mixing ZopeTestCase.Sandboxed and CMFTestCase?

Paul Winkler pw_lists at slinkp.com
Wed Oct 5 17:52:59 EDT 2005


Answering my own post, I just discovered something else:

Paul Winkler said:
> It mostly seems to work, but as far as I can tell, you *must*
> inherit in exactly that order, i.e.
>
> class MyTest(ZopeTestCase.Sandboxed, CMFTestCase.CMFTestCase):

As it turns out, even with my modification to setupCMFSite(),
you really *want* to inherit in this order anyway.
If you don't, Sandboxed doesn't seem to do any good.
i.e. if you inherit in that order, you will avoid polluting
the ZODB after the test suite finishes.  (At least that
seems to be the case from some quick experimentation, and
AFAICT that's the intended purpose of Sandboxed, right?)

If you inherit in the other order, e.g.
class Foo(CMFTestCase.CMFTestCase, ZopeTestCase.Sandboxed),
then you have to be sure you've deleted anything
that might still be around in beforeTearDown().
So I guess in that case there's no point in inheriting
from Sandboxed.

-- 
Paul Winkler
http://www.slinkp.com





More information about the Zope-CMF mailing list