Commit 6e273685 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[pyramid] Do not issue security warnings in test mode

When some session or authtk secret is missing in Pyramid settings,
scary "!! SECURITY WARNING !!" are issued. This is arguably pointless in
tests. So disable them in this case.
parent 68ca7fe0ca29
......@@ -198,7 +198,8 @@ def includeme(config):
session_prefix + 'secret', 'notsosecret')
persistent_secret = settings.get(
persistent_prefix + 'secret', 'notsosecret')
if 'notsosecret' in (session_secret, persistent_secret):
if ('notsosecret' in (session_secret, persistent_secret)
and config.registry['cubicweb.config'].mode != 'test'):
warnings.warn('''
!! SECURITY WARNING !!
......
......@@ -255,6 +255,7 @@ def includeme(config):
secret = settings['cubicweb.session.secret']
except KeyError:
secret = 'notsosecret'
if config.registry['cubicweb.config'].mode != 'test':
warnings.warn('''
!! WARNING !! !! WARNING !!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment