Changeset - 380d6d86da1f
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-07-06 16:24:26
marcin@python-works.com
Added option to swap the db connection uri based on ENV TEST_DB string
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/config/environment.py
Show inline comments
 
@@ -72,6 +72,10 @@ def load_environment(global_conf, app_co
 
    config['pylons.strict_tmpl_context'] = True
 
    test = os.path.split(config['__file__'])[-1] == 'test.ini'
 
    if test:
 
        if os.environ.get('TEST_DB'):
 
            # swap config if we pass enviroment variable
 
            config['sqlalchemy.db1.url'] = os.environ.get('TEST_DB')
 

	
 
        from rhodecode.lib.utils import create_test_env, create_test_index
 
        from rhodecode.tests import  TESTS_TMP_PATH
 
        create_test_env(TESTS_TMP_PATH, config)
 
@@ -80,7 +84,6 @@ def load_environment(global_conf, app_co
 
    # MULTIPLE DB configs
 
    # Setup the SQLAlchemy database engine
 
    sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.')
 

	
 
    init_model(sa_engine_db1)
 

	
 
    repos_path = make_ui('db').configitems('paths')[0][1]
0 comments (0 inline, 0 general)