[Zope] FunctionalTestCase commits transactions

Peter Bengtsson peter at fry-it.com
Wed Nov 5 10:14:15 EST 2008


2008/11/4 Dieter Maurer <dieter at handshake.de>:
> Ross Patterson wrote at 2008-11-3 16:04 -0800:
>> ...
>>If memory serves, a *functional* test fixture calls the Zope publisher
>>when a testbrowser request is made.  The publisher opens a new
>>transaction, as it should.
>
> Really?
>
> When I wrote a functional test browser (years before "zope3"),
> I emulated the Zope publisher rather than calling it directly
> in order to have control how transactions are handled.
>
> Especially, I used subtransactions instead of top level transactions
> to avoid the bug reported by Peter.
>

Uh? "subtransactions"?
So how would you recommend that I go abouts doing this?
In fact I've already written a custom tearDown() for my class that
cleans the test database (postgresql) which is quite neat because I
can write tests in a completely different way as each test can build
on each other (assuming order of methods is respected) similar to how
doctests are done where you have blocks of shell code split between
text.

If this is the way it has to be to test with zope.testbrowser in zope
2 then I'll let it be so.

-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com


More information about the Zope mailing list