Move PyramidCWTest to pyramid_cubicweb.tests
authorChristophe de Vienne <christophe@unlish.com>
Wed, 22 Oct 2014 16:15:54 +0200
changeset 11514 82e86cd8e217
parent 11513 0170f8a55620
child 11515 b3267ba817b4
Move PyramidCWTest to pyramid_cubicweb.tests
pyramid_cubicweb/tests/__init__.py
pyramid_cubicweb/tests/test_bw_request.py
--- a/pyramid_cubicweb/tests/__init__.py	Mon Sep 22 12:15:31 2014 +0200
+++ b/pyramid_cubicweb/tests/__init__.py	Wed Oct 22 16:15:54 2014 +0200
@@ -0,0 +1,26 @@
+import webtest
+
+from cubicweb.devtools.webtest import CubicWebTestTC
+
+from pyramid_cubicweb import make_cubicweb_application
+
+
+class PyramidCWTest(CubicWebTestTC):
+    @classmethod
+    def init_config(cls, config):
+        super(PyramidCWTest, cls).init_config(config)
+        config.global_set_option('https-url', 'https://localhost.local/')
+        config.global_set_option('anonymous-user', 'anon')
+        config['pyramid-auth-secret'] = 'authsecret'
+        config['pyramid-session-secret'] = 'sessionsecret'
+
+    def setUp(self):
+        # Skip CubicWebTestTC setUp
+        super(CubicWebTestTC, self).setUp()
+        config = make_cubicweb_application(self.config)
+        self.includeme(config)
+        self.pyr_registry = config.registry
+        self.webapp = webtest.TestApp(config.make_wsgi_app())
+
+    def includeme(self, config):
+        pass
--- a/pyramid_cubicweb/tests/test_bw_request.py	Mon Sep 22 12:15:31 2014 +0200
+++ b/pyramid_cubicweb/tests/test_bw_request.py	Wed Oct 22 16:15:54 2014 +0200
@@ -2,28 +2,11 @@
 from StringIO import StringIO
 
 import webtest
+
 import pyramid.request
 
-from cubicweb.devtools.webtest import CubicWebTestTC
-
-from pyramid_cubicweb import make_cubicweb_application
 from pyramid_cubicweb.core import CubicWebPyramidRequest
-
-
-class PyramidCWTest(CubicWebTestTC):
-    @classmethod
-    def init_config(cls, config):
-        super(PyramidCWTest, cls).init_config(config)
-        config.global_set_option('https-url', 'https://localhost.local/')
-        config['pyramid-auth-secret'] = 'authsecret'
-        config['pyramid-session-secret'] = 'sessionsecret'
-
-    def setUp(self):
-        # Skip CubicWebTestTC setUp
-        super(CubicWebTestTC, self).setUp()
-        config = make_cubicweb_application(self.config)
-        self.pyr_registry = config.registry
-        self.webapp = webtest.TestApp(config.make_wsgi_app())
+from pyramid_cubicweb.tests import PyramidCWTest
 
 
 class WSGIAppTest(PyramidCWTest):