40 lines
940 B
Python
40 lines
940 B
Python
from odoo_openupgrade_wizard.tools_postgres import (
|
|
ensure_database,
|
|
execute_sql_request,
|
|
)
|
|
|
|
from . import (
|
|
build_ctx_from_config_file,
|
|
cli_runner_invoke,
|
|
move_to_test_folder,
|
|
)
|
|
|
|
|
|
def test_cli_install_from_csv():
|
|
move_to_test_folder()
|
|
|
|
# Initialize database
|
|
db_name = "database_test_cli___install_from_csv"
|
|
ctx = build_ctx_from_config_file()
|
|
ensure_database(ctx, db_name, state="absent")
|
|
|
|
cli_runner_invoke(
|
|
[
|
|
"--log-level=DEBUG",
|
|
"install-from-csv",
|
|
"--database=%s" % db_name,
|
|
]
|
|
)
|
|
|
|
# Ensure that 'account' is installed
|
|
# and also 'product', by dependencies
|
|
request = (
|
|
"SELECT count(*)"
|
|
" FROM ir_module_module"
|
|
" WHERE state ='installed'"
|
|
" AND name in ('product', 'account');"
|
|
)
|
|
module_qty = int(execute_sql_request(ctx, request, database=db_name)[0][0])
|
|
|
|
assert module_qty == 2
|