pyramid_cubicweb/tests/__init__.py
author David Douard <david.douard@logilab.fr>
Tue, 12 Apr 2016 16:17:06 +0200
changeset 11617 5d4d6bde0dc5
parent 11606 e245680acce3
permissions -rw-r--r--
Added tag 0.6.1, debian/0.6.1-1 for changeset 2621daafa10c

import webtest

from cubicweb.devtools.webtest import CubicWebTestTC

from pyramid_cubicweb import make_cubicweb_application


class PyramidCWTest(CubicWebTestTC):
    settings = {}

    @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.https_uiprops = None
        config.https_datadir_url = None

    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