tests: Add a fixture to get the settings dict.
This commit is contained in:
parent
753b920fa8
commit
24d3455854
1 changed files with 16 additions and 0 deletions
|
|
@ -214,6 +214,22 @@ def app(request, pylonsapp, http_environ):
|
|||
return app
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def app_settings(pylonsapp, pylons_config):
|
||||
"""
|
||||
Settings dictionary used to create the app.
|
||||
|
||||
Parses the ini file and passes the result through the sanitize and apply
|
||||
defaults mechanism in `rhodecode.config.middleware`.
|
||||
"""
|
||||
from paste.deploy.loadwsgi import loadcontext, APP
|
||||
from rhodecode.config.middleware import (
|
||||
sanitize_settings_and_apply_defaults)
|
||||
context = loadcontext(APP, 'config:' + pylons_config)
|
||||
settings = sanitize_settings_and_apply_defaults(context.config())
|
||||
return settings
|
||||
|
||||
|
||||
LoginData = collections.namedtuple('LoginData', ('csrf_token', 'user'))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue