-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Odoo 11 Development Cookbook - Second Edition - Second Edition
By :
Now that you know how to write tests, let's see how you can run them!
We will reuse the tests for the my_module module from one of the previous recipes. You will need an instance with the addon installed. In this recipe, we assume that the instance configuration file is in project.cfg.
To run the tests for my module addon, install the module with demo data:
$ ./odoo-bin -c project.cfg --without-demo=False --stop-after-init \
-i my_moduleThen, run the following command:
$ ./odoo-bin -c project.cfg --test-enable --log-level=error \
--stop-after-init -u my_moduleThe key part in this recipe is the --test-enable command-line flag that tells Odoo to run the tests. The --stop-after-init flag will stop the instance after the tests have run, and -u will update the specified module. When an update (or install) is performed with tests enabled, all the affected addon modules' tests are run (this includes dependencies automatically installed...