summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_renderer.js
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2020-04-17 14:07:27 +0000
committerRaphael Collet <rco@odoo.com>2020-04-22 07:45:53 +0000
commitca91e13dee168af45b12ec054b6dd57346f5c5f1 (patch)
tree8c18d1e1ccf41bc748504eeb54ad2788be7d46a1 /addons/web/static/src/js/views/basic/basic_renderer.js
parentbaf1c1406bcf148885fc40a9a050731bf4402f75 (diff)
[IMP] testing: forbid module operations during testing
With this commit, module operations such as install, upgrades and uninstalls are henceforth forbidden inside unit tests and instead such tests must be performed with standalone Odoo scripts. This is done because module operations during tests are not transactional, this can leave the registry in an unclean state and further tests may be affected by this, it also creates a new registry which complicates registry cleanup if anything crashes, because the registry to be cleaned up is not the same one that crashed. Instead, what should be done is a script that imports odoo as a library, and loads the database necessary then performs whichever operations necessary. This script should contain a single function with a single parameter (env) and should be decorated with @odoo.tests.common.standalone in order to be executed properly, this decorator accepts any amount of positional parameters as tags that can be specified when calling the script in order to execute only a select subset of scripts. Special tags are: 'all' and <module_name>, these are generated automatically, the first will execute ALL scripts available whereas <module_name> will execute all scripts introduced by said module. When calling the test_module_operations script, only scripts found in *installed* modules will be executed, script discovery is only possible if the code is loaded therefore it is only possible if the module is installed. closes odoo/odoo#49669 Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_renderer.js')
0 files changed, 0 insertions, 0 deletions