[pyramid] Use existing repo in PyramidCWTest
authorDenis Laxalde <denis.laxalde@logilab.fr>
Tue, 21 Feb 2017 17:41:32 +0100
changeset 11971 6c035cfef04f
parent 11970 b282ef22b5ab
child 11972 a2bc933ffb59
[pyramid] Use existing repo in PyramidCWTest We thus do not make use of config_from_cwconfig() and build the configurator instance by hand prior to include 'cubicweb.pyramid'.
cubicweb/pyramid/test/__init__.py
--- a/cubicweb/pyramid/test/__init__.py	Tue Feb 21 17:35:16 2017 +0100
+++ b/cubicweb/pyramid/test/__init__.py	Tue Feb 21 17:41:32 2017 +0100
@@ -1,9 +1,8 @@
 import webtest
 
+from pyramid.config import Configurator
 from cubicweb.devtools.webtest import CubicWebTestTC
 
-from cubicweb.pyramid import config_from_cwconfig
-
 
 class PyramidCWTest(CubicWebTestTC):
     settings = {}
@@ -16,7 +15,9 @@
     def setUp(self):
         # Skip CubicWebTestTC setUp
         super(CubicWebTestTC, self).setUp()
-        config = config_from_cwconfig(self.config, self.settings)
+        config = Configurator(settings=self.settings)
+        config.registry['cubicweb.repository'] = self.repo
+        config.include('cubicweb.pyramid')
         self.includeme(config)
         self.pyr_registry = config.registry
         self.webapp = webtest.TestApp(