--- a/pyramid_cubicweb/__init__.py Wed Apr 29 11:39:35 2015 +0200
+++ b/pyramid_cubicweb/__init__.py Tue Apr 28 11:04:03 2015 +0200
@@ -12,7 +12,7 @@
from ConfigParser import SafeConfigParser
-def make_cubicweb_application(cwconfig):
+def make_cubicweb_application(cwconfig, settings=None):
"""
Create a pyramid-based CubicWeb instance from a cubicweb configuration.
@@ -23,7 +23,7 @@
"""
settings_filenames = [os.path.join(cwconfig.apphome, 'pyramid.ini')]
- settings = {}
+ settings = dict(settings) if settings else {}
if cwconfig.debugmode:
settings_filenames.insert(
--- a/pyramid_cubicweb/tests/__init__.py Wed Apr 29 11:39:35 2015 +0200
+++ b/pyramid_cubicweb/tests/__init__.py Tue Apr 28 11:04:03 2015 +0200
@@ -6,6 +6,8 @@
class PyramidCWTest(CubicWebTestTC):
+ settings = {}
+
@classmethod
def init_config(cls, config):
super(PyramidCWTest, cls).init_config(config)
@@ -17,7 +19,7 @@
def setUp(self):
# Skip CubicWebTestTC setUp
super(CubicWebTestTC, self).setUp()
- config = make_cubicweb_application(self.config)
+ config = make_cubicweb_application(self.config, self.settings)
self.includeme(config)
self.pyr_registry = config.registry
self.webapp = webtest.TestApp(config.make_wsgi_app())