sampleapp/sampleapp/tests.py
author Julien Cristau <julien.cristau@logilab.fr>
Wed, 25 Nov 2015 12:32:59 +0100
changeset 11607 5b36399b6b21
parent 11483 7b7ed56bf2fb
permissions -rw-r--r--
[bwcompat] also set response headers in error cases I had this sitting around in my local copy, I don't remember why I needed this but it seems correct.

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')