sampleapp/sampleapp/tests.py
author Christophe de Vienne <christophe@unlish.com>
Mon, 22 Sep 2014 09:40:43 +0200
changeset 11512 bb548010b390
parent 11483 7b7ed56bf2fb
permissions -rw-r--r--
Use lightweight sessions Provides a lightweight version of repo.connect() that does not keep track of opened sessions. The speed gain on a mostly static front page is about 5% Warning ! This means that, for now, the "session_open" and "session_close" hooks are NOT called anymore.

import unittest

from pyramid import testing


class ViewTests(unittest.TestCase):
    def setUp(self):
        self.config = testing.setUp()

    def tearDown(self):
        testing.tearDown()

    def test_my_view(self):
        from .views import my_view
        request = testing.DummyRequest()
        info = my_view(request)
        self.assertEqual(info['project'], 'cubi')