diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index 320e689984a..cc3bdc2ce7b 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -634,14 +634,14 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): def load_test(cr, module_name, id_map, mode): cr.commit() - if not tools.config.options['test-disable']: + if not tools.config.options['test_disable']: try: _load_data(cr, module_name, id_map, mode, 'test') except Exception, e: logger.notifyChannel('ERROR', netsvc.LOG_TEST, e) pass finally: - if tools.config.options['test-commit']: + if tools.config.options['test_commit']: cr.commit() else: cr.rollback() diff --git a/bin/openerp-server.py b/bin/openerp-server.py index 5a68440af27..92e945acda0 100755 --- a/bin/openerp-server.py +++ b/bin/openerp-server.py @@ -116,11 +116,11 @@ if not ( tools.config["stop_after_init"] or \ if tools.config['db_name']: for dbname in tools.config['db_name'].split(','): db,pool = pooler.get_db_and_pool(dbname, update_module=tools.config['init'] or tools.config['update'], pooljobs=False) - if tools.config["test-file"]: + if tools.config["test_file"]: logger.notifyChannel("init", netsvc.LOG_INFO, - 'loading test file %s' % (tools.config["test-file"],)) + 'loading test file %s' % (tools.config["test_file"],)) cr = db.cursor() - tools.convert_yaml_import(cr, 'base', file(tools.config["test-file"]), {}, 'test', True) + tools.convert_yaml_import(cr, 'base', file(tools.config["test_file"]), {}, 'test', True) cr.rollback() pool.get('ir.cron')._poolJobs(db.dbname) diff --git a/bin/tools/config.py b/bin/tools/config.py index 6bbeb89ac8e..4220e259e32 100644 --- a/bin/tools/config.py +++ b/bin/tools/config.py @@ -82,9 +82,9 @@ class configmanager(object): 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ - 'test-file' : False, - 'test-disable' : False, - 'test-commit' : False, + 'test_file' : False, + 'test_disable' : False, + 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, @@ -155,10 +155,10 @@ class configmanager(object): # Testing Group group = optparse.OptionGroup(parser, "Testing Configuration") - group.add_option("--test-file", dest="test-file", help="Launch a YML test file.") - group.add_option("--test-disable", action="store_true", dest="test-disable", + group.add_option("--test-file", dest="test_file", help="Launch a YML test file.") + group.add_option("--test-disable", action="store_true", dest="test_disable", default=False, help="Disable loading test files.") - group.add_option("--test-commit", action="store_true", dest="test-commit", + group.add_option("--test-commit", action="store_true", dest="test_commit", default=False, help="Commit database changes performed by tests.") parser.add_option_group(group) @@ -283,7 +283,7 @@ class configmanager(object): keys = ['language', 'translate_out', 'translate_in', 'debug_mode', 'stop_after_init', 'logrotate', 'without_demo', 'netrpc', 'xmlrpc', 'syslog', 'list_db', 'server_actions_allow_code', 'xmlrpcs', - 'test-file', 'test-disable', 'test-commit' + 'test_file', 'test_disable', 'test_commit' ] for arg in keys: