summaryrefslogtreecommitdiff
path: root/odoo/tests/test_module_operations.py
AgeCommit message (Collapse)Author
2021-02-18[IMP] tests: add data_dir support in test_module_operationsChristophe Monniez
In some situations, like during tests on runbot, the data-dir location may vary. With this commit, the `data-dir` CLI argument is added to the test_module_operations script. closes odoo/odoo#66422 Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2020-10-01[FIX] base_setup, website, tests: remove Gengo referencesNicolas Martinelli
The Gengo modules were removed with: https://github.com/odoo/odoo/commit/b38b72e456a https://github.com/odoo/odoo/commit/9b1f0962baa But there are still references to it. opw-2349904 closes odoo/odoo#58931 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-08-19[REF] core: move testing-related functions to odoo/tests submodulesXavier Morel
Attempts to clean up odoo/module and odoo/service a tad, they still invoke testing-related utilities but are more logical in what they *contain*.
2020-04-22[IMP] testing: forbid module operations during testingAdrian Torres
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>