Book Image

Odoo Development Cookbook

By : Holger Brunn, Alexandre Fayolle, Daniel Reis
Book Image

Odoo Development Cookbook

By: Holger Brunn, Alexandre Fayolle, Daniel Reis

Overview of this book

Odoo is a full-featured open source ERP with a focus on extensibility. The flexibility and sustainability of open source is also a key selling point of Odoo. It is built on a powerful framework for rapid application development, both for back-end applications and front-end websites. The book starts by covering Odoo installation and administration, and provides a gentle introduction to application development. It then dives deep into several of the areas that an experienced developer will need to use. You’ll learn implement business logic, adapt the UI, and extend existing features.
Table of Contents (23 chapters)
Odoo Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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 -u will update the specified module. When an update (or install) is performed in test mode, all the affected addon modules' tests are run (this includes dependencies automatically installed or reverse dependencies automatically updated; see the recipe...