O'Reilly logo

Odoo Development Cookbook by Daniel Reis, Alexandre Fayolle, Holger Brunn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running server tests

The two previous recipes showed how to write tests. Let's see how to run them! This recipe works for both YAML and Python unit tests.

Getting ready

We will be reusing 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.

How to do it…

To run the tests for my module addon, run the following command:

$ odoo/odoo.py -c project.cfg --test-enable --log-level=error --stop-after-init -u my_module

How it works…

The 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required