From 9e225c7c1e599624d419cd87f1705ad9a8dcb162 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Wed, 16 Nov 2011 13:11:42 +0100 Subject: [PATCH] [IMP] check the -d option is also provided when using --run-tests. bzr revid: vmt@openerp.com-20111116121142-bxahffcr7diseoiy --- openerp/tools/config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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,