-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Odoo Development Cookbook
By :

When you run the Odoo server with the --test-enabled
module name, the test cases run immediately after the module is installed. If you want to run a test case after the installation of all the modules, or if you just want to run a test case for only one module, a tagged()
decorator is the answer.
In this recipe, we’ll show you how to utilize this decorator specifically for shaping test cases. It’s important to note that this decorator only applies to classes; it doesn’t affect functions or methods. Tags can be modified by adding a minus (-) sign as a prefix, which removes them instead of adding or selecting them. For example, if you want to prevent your test from being executed by default, you can remove the standard tag.
For this recipe, we will use the my_hostel
module from the last recipe. We will modify the sequence of the test case.
Follow these steps to add tags to the Python test...