db: Change ordering of test env setup and db connection init.
- DB init sets rhodecode.model.db.ENCRYPTION_KEY - Test env setup resets rhodecode.model.db.ENCRYPTION_KEY to None - Therefore DB init has to be done after test env setup.
This commit is contained in:
parent
422f825bb8
commit
c58dd1646e
1 changed files with 4 additions and 3 deletions
|
|
@ -165,14 +165,15 @@ def make_pyramid_app(global_config, **settings):
|
|||
config = Configurator(settings=settings)
|
||||
add_pylons_compat_data(config.registry, global_config, settings_pylons)
|
||||
|
||||
# Initialize the database connection.
|
||||
utils.initialize_database(settings_merged)
|
||||
|
||||
# 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']:
|
||||
utils.initialize_test_environment(settings_merged)
|
||||
|
||||
# Initialize the database connection.
|
||||
utils.initialize_database(settings_merged)
|
||||
|
||||
includeme(config)
|
||||
includeme_last(config)
|
||||
pyramid_app = config.make_wsgi_app()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue