unittest in Tryton: TestCase from trytond.tests.test_tryton import ( DB_NAME, USER, CONTEXT) def test_example(self): with Transaction().start(DB_NAME, USER, context=CONTEXT): ... Each test is run inside its own transaction Better to rollback at the end (not yet in base)