cubicweb/pyramid/test/__init__.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 23 Jan 2017 11:02:21 +0100
changeset 11913 4516c3956d46
parent 11631 faf279e33298
child 11958 950ce7d9f642
permissions -rw-r--r--
Drop support for https-url in all-in-one.conf This feature allowing an instance to have both anonymous and authenticated (https) url is not used anymore, let's drop it.

import webtest

from cubicweb.devtools.webtest import CubicWebTestTC

from cubicweb.pyramid import make_cubicweb_application


class PyramidCWTest(CubicWebTestTC):
    settings = {}

    @classmethod
    def init_config(cls, config):
        super(PyramidCWTest, cls).init_config(config)
        config.global_set_option('anonymous-user', 'anon')

    def setUp(self):
        # Skip CubicWebTestTC setUp
        super(CubicWebTestTC, self).setUp()
        config = make_cubicweb_application(self.config, self.settings)
        self.includeme(config)
        self.pyr_registry = config.registry
        self.webapp = webtest.TestApp(
            config.make_wsgi_app(),
            extra_environ={'wsgi.url_scheme': 'https'})

    def includeme(self, config):
        pass