cubicweb/pyramid/session.py
changeset 12243 a46fb3f58ea2
parent 12225 a8ed10f80a85
child 12278 77a543e7878a
--- a/cubicweb/pyramid/session.py	Thu Nov 30 11:55:35 2017 +0100
+++ b/cubicweb/pyramid/session.py	Fri Dec 01 11:12:09 2017 +0100
@@ -255,17 +255,18 @@
         secret = settings['cubicweb.session.secret']
     except KeyError:
         secret = 'notsosecret'
-        warnings.warn('''
+        if config.registry['cubicweb.config'].mode != 'test':
+            warnings.warn('''
 
-            !! WARNING !! !! WARNING !!
+                !! WARNING !! !! WARNING !!
 
-            The session cookies are signed with a static secret key.
-            To put your own secret key, edit your pyramid.ini file
-            and set the 'cubicweb.session.secret' key.
+                The session cookies are signed with a static secret key.
+                To put your own secret key, edit your pyramid.ini file
+                and set the 'cubicweb.session.secret' key.
 
-            YOU SHOULD STOP THIS INSTANCE unless your really know what you
-            are doing !!
+                YOU SHOULD STOP THIS INSTANCE unless your really know what you
+                are doing !!
 
-        ''')
+            ''')
     session_factory = CWSessionFactory(secret)
     config.set_session_factory(session_factory)