Odoo supports different ways of writing addon module tests, YAML tests, and Python tests. Writing YAML tests for new modules is not encouraged by the editors, and it is quite possible that the support will be dropped altogether in a future version. Therefore, we will not cover these in this book, and we will instead focus on Python unit tests.
If you are familiar with the Python unit testing tools, you will be pleased to know that these are also available within the Odoo framework.
In this recipe, we will see how to write Python unit tests for the my_module methods we wrote in the Define Model methods and use the API decorators recipe in Chapter 6, Basic Server-Side Development.