# HG changeset patch # User Johannes Bornhold # Date 2016-06-07 09:13:50 # Node ID 931f58e596aa4e02d91e321b5adbc9725446e1fd # Parent 25511505e5aa352b63dda89bb0cde04c68de981f db: Set `rhodecode.is_test` in `make_pyramid_app` instead of `make_app` Based on this setting the crypto backend is selected: brypt or md5. During tests md5 is used to sppedup test execution. We have to move this setting up to the pyramid layer otherwise the test DB init will use bcrypt and the tests use md5. This will result in test users not able to login. diff --git a/rhodecode/config/environment.py b/rhodecode/config/environment.py --- a/rhodecode/config/environment.py +++ b/rhodecode/config/environment.py @@ -62,7 +62,6 @@ def load_environment(global_conf, app_co """ config = PylonsConfig() - rhodecode.is_test = str2bool(app_conf.get('is_test', 'False')) # Pylons paths root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) diff --git a/rhodecode/config/middleware.py b/rhodecode/config/middleware.py --- a/rhodecode/config/middleware.py +++ b/rhodecode/config/middleware.py @@ -168,7 +168,9 @@ def make_pyramid_app(global_config, **se # If this is a test run we prepare the test environment like # creating a test database, test search index and test repositories. # This has to be done before the database connection is initialized. + # if settings['is_test']: if settings['is_test']: + rhodecode.is_test = True utils.initialize_test_environment(settings_merged) # Initialize the database connection. @@ -316,6 +318,7 @@ def sanitize_settings_and_apply_defaults _bool_setting(settings, 'vcs.server.enable', 'true') _bool_setting(settings, 'static_files', 'true') + _bool_setting(settings, 'is_test', 'false') return settings