11ba4689b1
Some tests (e.g. mail) have expensive and significant DB setup for a number of small and cheap tests. Using a TransactionCase, the DB setup far dominates the tests themselves, by up to 10x (mail unit tests take ~130s on my machine, the tests themselves take ~15s). The SavepointCase introduced here is an hybrid of SingleTransactionCase and TransactionCase: it uses a single transaction for all tests in a class, but each test case is isolated by a rollbacked savepoint. This allows a common DB setup (via setUpClass) while keeping independent tests. TransactionCase should remain the primary test case superclass, but SavepointCase can be a fair optimisation when setup costs far dominate. |
||
---|---|---|
.. | ||
i18n | ||
security | ||
static | ||
tests | ||
views | ||
wizard | ||
__init__.py | ||
__openerp__.py | ||
mail_mail.py | ||
mail_message.py | ||
mail_thread.py | ||
portal.py | ||
portal_data.xml | ||
portal_demo.xml | ||
portal_view.xml |