Only a side note: never ever use commit() with tests.

If I may hijack your side note: is there any way to suppress explicit
transaction commits when running tests?

This statements makes no sense to me. Every test of a test runs
insolated within the same predefinied environment as defined through the
 fixture in the testsuite. There should not be any commit operation
happening - never.

- -aj


I have an actual use case but I'll provide a simple hypothetical one: I have a method which iterates over many objects, assembles an XML representation, posts it to a remote server, edits the object and flags it as processed. Since I don't want to post to the remote server more than once I must commit after each iteration, in case by method fails after 1000 iterations and the ZODB rolls everything (but my XML posts) back.

The transaction.commit() is definitely needed in my method.

H

_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to