Exemple #1
0
    def test_add_renderer_globals(self):
        from kotti.views.util import add_renderer_globals

        request = DummyRequest()
        event = {"request": request, "context": object(), "renderer_name": "foo"}
        add_renderer_globals(event)
        self.assertTrue("api" in event)
Exemple #2
0
    def test_add_renderer_globals_event_has_no_renderer_name(self, db_session):
        from kotti.views.util import add_renderer_globals

        request = DummyRequest()
        event = {"request": request, "context": object()}
        add_renderer_globals(event)
        assert "api" in event
Exemple #3
0
    def test_add_renderer_globals_event_has_no_renderer_name(self, db_session):
        from kotti.views.util import add_renderer_globals

        request = DummyRequest()
        event = {"request": request, "context": object()}
        add_renderer_globals(event)
        assert "api" in event
Exemple #4
0
    def test_add_renderer_globals_request_has_template_api(self):
        from kotti.views.util import add_renderer_globals

        request = DummyRequest()
        request.template_api = template_api = object()
        event = {'request': request, 'renderer_name': 'foo'}
        add_renderer_globals(event)
        assert event['api'] is template_api
Exemple #5
0
    def test_add_renderer_globals_request_has_template_api(self):
        from kotti.views.util import add_renderer_globals

        request = DummyRequest()
        request.template_api = template_api = object()
        event = {'request': request, 'renderer_name': 'foo'}
        add_renderer_globals(event)
        assert event['api'] is template_api
Exemple #6
0
    def test_add_renderer_globals_request_has_template_api(self):
        from kotti.views.util import add_renderer_globals

        request = DummyRequest()
        request.template_api = template_api = object()
        event = {"request": request, "renderer_name": "foo"}
        add_renderer_globals(event)
        self.assertTrue(event["api"] is template_api)
Exemple #7
0
    def test_add_renderer_globals_request_has_template_api(self):
        from kotti.views.util import add_renderer_globals

        request = DummyRequest()
        request.template_api = template_api = object()
        event = {"request": request, "renderer_name": "foo"}
        add_renderer_globals(event)
        assert event["api"] is template_api
Exemple #8
0
    def test_add_renderer_globals_event_has_no_renderer_name(self, db_session):
        from kotti.views.util import add_renderer_globals

        request = DummyRequest()
        event = {
            'request': request,
            'context': object(),
            }
        add_renderer_globals(event)
        assert 'api' in event
Exemple #9
0
    def test_add_renderer_globals_event_has_no_renderer_name(self, db_session):
        from kotti.views.util import add_renderer_globals

        request = DummyRequest()
        event = {
            'request': request,
            'context': object(),
        }
        add_renderer_globals(event)
        assert 'api' in event
Exemple #10
0
    def test_add_renderer_globals(self):
        from kotti.views.util import add_renderer_globals

        request = DummyRequest()
        event = {
            'request': request,
            'context': object(),
            'renderer_name': 'foo',
        }
        add_renderer_globals(event)
        self.assertTrue('api' in event)
Exemple #11
0
    def test_add_renderer_globals(self):
        from kotti.views.util import add_renderer_globals

        request = DummyRequest()
        event = {
            'request': request,
            'context': object(),
            'renderer_name': 'foo',
            }
        add_renderer_globals(event)
        self.assertTrue('api' in event)
Exemple #12
0
    def test_add_renderer_globals_json(self):
        from kotti.views.util import add_renderer_globals

        event = {'renderer_name': 'json'}
        add_renderer_globals(event)
        assert event.keys() == ['renderer_name']
Exemple #13
0
    def test_add_renderer_globals_json(self):
        from kotti.views.util import add_renderer_globals

        event = {'renderer_name': 'json'}
        add_renderer_globals(event)
        assert event.keys() == ['renderer_name']
Exemple #14
0
    def test_add_renderer_globals_json(self):
        from kotti.views.util import add_renderer_globals

        event = {"renderer_name": "json"}
        add_renderer_globals(event)
        self.assertEqual(event.keys(), ["renderer_name"])
Exemple #15
0
    def test_add_renderer_globals_json(self):
        from kotti.views.util import add_renderer_globals

        event = {"renderer_name": "json"}
        add_renderer_globals(event)
        assert list(event.keys()) == ["renderer_name"]
Exemple #16
0
    def test_add_renderer_globals_json(self):
        from kotti.views.util import add_renderer_globals

        event = {"renderer_name": "json"}
        add_renderer_globals(event)
        assert list(event.keys()) == ["renderer_name"]