openerp-expert-framework team mailing list archive
-
openerp-expert-framework team
-
Mailing list archive
-
Message #00160
Testing and data.
As the community is getting aware of importance of tests, there are some
things we should pay attention when coding to make writing tests easier.
Since tests might run on random order, an important rule of testing is
that, whatever changes the test does to the database, it should revert
it. The easiest way to follow this rule is simply not committing the
changes to the database at the end of the test run.
So, in order to ease the writing of tests we should:
* Get rid of a few "cr.commit()"s spread through the modules. In
"stock/stock.py:1502", for example, there's one for apparent no good
reason.
* Run the server in a "test mode" where
a) unit tests (in XML files) run in a single transaction.
b) xml-rpc "start_transaction" and "rollback_transaction" methods
are available so functional tests work as expected.