diff --git a/openerp/tools/config.py b/openerp/tools/config.py index 2b27844ceed..7d496d524b1 100644 --- a/openerp/tools/config.py +++ b/openerp/tools/config.py @@ -267,9 +267,9 @@ class configmanager(object): group.add_option("--unaccent", dest="unaccent", my_default=False, action="store_true", help="Use the unaccent function provided by the database when available.") group.add_option("--run-tests", dest="run_tests", my_default=False, action="store_true", - help="Run a test suite.") + help="Run a test suite. This creates a database (possibly created with --run-tests-no-db).") group.add_option("--run-tests-no-db", dest="run_tests_no_db", my_default=False, action="store_true", - help="Run a test suite (which does'nt assume an existing database).") + help="Run a test suite (which doesn't assume an existing database).") parser.add_option_group(group) @@ -327,6 +327,10 @@ class configmanager(object): "The config file '%s' selected with -c/--config doesn't exist, "\ "use -s/--save if you want to generate it"%(opt.config)) + die((opt.run_tests or opt.run_tests_no_db) and not opt.db_name, + "The --run-tests and --run-tests-no-db need a database name "\ + "(using the --database or -d options).") + # place/search the config file on Win32 near the server installation # (../etc from the server) # if the server is run by an unprivileged user, he has to specify location of a config file where he has the rights to write,