moved database connection call into the get_base_config function so it is not attempted at import time. this is necessary to allow the behave tests to create a test database

pull/56/head
Chris Veilleux 2019-02-25 01:48:02 -06:00
parent 95a5d383e9
commit d71ae4831c
1 changed files with 5 additions and 1 deletions

View File

@ -38,7 +38,7 @@ class APIConfigError(Exception):
class BaseConfig(object):
"""Base configuration."""
ACCESS_SECRET = os.environ['JWT_ACCESS_SECRET']
DB_CONNECTION_POOL = allocate_db_connection_pool(db_connection_config)
DB_CONNECTION_POOL = None
DEBUG = False
ENV = os.environ['SELENE_ENVIRONMENT']
REFRESH_SECRET = os.environ['JWT_REFRESH_SECRET']
@ -79,4 +79,8 @@ def get_base_config():
error_msg = 'no configuration defined for the "{}" environment'
raise APIConfigError(error_msg.format(environment_name))
app_config.DB_CONNECTION_POOL = allocate_db_connection_pool(
db_connection_config
)
return app_config