[FIX] correct name for custom script in execute_script tests
This commit is contained in:
parent
21c744b6c7
commit
624387b89d
|
|
@ -18,7 +18,6 @@ class OdooInstance:
|
|||
env = False
|
||||
version = False
|
||||
|
||||
# constructeur de la classe
|
||||
def __init__(self, ctx, database):
|
||||
# # TODO, improve me waith for response on http://localhost:port
|
||||
# # with a time out
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ from . import cli_runner_invoke
|
|||
def test_cli_execute_script():
|
||||
output_folder_path = Path("./tests/output_B")
|
||||
|
||||
extra_script_path = Path("./tests/extra_script_B/post-migration-custom.py")
|
||||
extra_script_path = Path(
|
||||
"./tests/extra_script_B/post-migration-custom_test.py"
|
||||
)
|
||||
|
||||
db_name = "database_test_cli_execute_script"
|
||||
|
||||
|
|
|
|||
39
tests/extra_script_B/post-migration-custom_test.py
Normal file
39
tests/extra_script_B/post-migration-custom_test.py
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
def main(self):
|
||||
|
||||
# Classic ORM usage Checks
|
||||
partners = self.browse_by_search("res.partner")
|
||||
|
||||
self.browse_by_create("res.partner", {"name": "New Partner"})
|
||||
|
||||
new_partners = self.browse_by_search("res.partner")
|
||||
|
||||
if len(partners) + 1 != len(new_partners):
|
||||
raise Exception("Creation of partner failed.")
|
||||
|
||||
# Install / uninstall modules checks
|
||||
if self.check_modules_installed("sale"):
|
||||
self.uninstall_modules("sale")
|
||||
|
||||
self.install_modules("sale")
|
||||
|
||||
if not self.check_modules_installed("sale"):
|
||||
raise Exception("'sale' module should be installed")
|
||||
|
||||
self.uninstall_modules(["product"])
|
||||
|
||||
if self.check_modules_installed("sale"):
|
||||
raise Exception(
|
||||
"'sale' module should not be installed"
|
||||
" after uninstallation of product"
|
||||
)
|
||||
|
||||
# models checks
|
||||
if not self.check_models_present("res.partner"):
|
||||
raise Exception("'res.partner' model should be present.")
|
||||
|
||||
if self.check_models_present("res.partner.unexisting.model"):
|
||||
raise Exception(
|
||||
"'res.partner.unexisting.model' model" " should not be present."
|
||||
)
|
||||
|
||||
#
|
||||
Loading…
Reference in New Issue
Block a user