diff options
Diffstat (limited to 'docs/quick_tour')
| -rw-r--r-- | docs/quick_tour/logging/hello_world/tests.py | 10 | ||||
| -rw-r--r-- | docs/quick_tour/package/hello_world/tests.py | 10 | ||||
| -rw-r--r-- | docs/quick_tour/sessions/hello_world/tests.py | 10 |
3 files changed, 30 insertions, 0 deletions
diff --git a/docs/quick_tour/logging/hello_world/tests.py b/docs/quick_tour/logging/hello_world/tests.py index f01ae2a3c..b747e7679 100644 --- a/docs/quick_tour/logging/hello_world/tests.py +++ b/docs/quick_tour/logging/hello_world/tests.py @@ -16,6 +16,12 @@ class ViewTests(unittest.TestCase): info = my_view(request) self.assertEqual(info['project'], 'hello_world') + def test_notfound_view(self): + from .views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + class FunctionalTests(unittest.TestCase): def setUp(self): @@ -27,3 +33,7 @@ class FunctionalTests(unittest.TestCase): def test_root(self): res = self.testapp.get('/', status=200) self.assertTrue(b'Pyramid' in res.body) + + def test_notfound(self): + res = self.testapp.get('/badurl', status=404) + self.assertTrue(res.status_code == 404) diff --git a/docs/quick_tour/package/hello_world/tests.py b/docs/quick_tour/package/hello_world/tests.py index f01ae2a3c..b747e7679 100644 --- a/docs/quick_tour/package/hello_world/tests.py +++ b/docs/quick_tour/package/hello_world/tests.py @@ -16,6 +16,12 @@ class ViewTests(unittest.TestCase): info = my_view(request) self.assertEqual(info['project'], 'hello_world') + def test_notfound_view(self): + from .views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + class FunctionalTests(unittest.TestCase): def setUp(self): @@ -27,3 +33,7 @@ class FunctionalTests(unittest.TestCase): def test_root(self): res = self.testapp.get('/', status=200) self.assertTrue(b'Pyramid' in res.body) + + def test_notfound(self): + res = self.testapp.get('/badurl', status=404) + self.assertTrue(res.status_code == 404) diff --git a/docs/quick_tour/sessions/hello_world/tests.py b/docs/quick_tour/sessions/hello_world/tests.py index f01ae2a3c..b747e7679 100644 --- a/docs/quick_tour/sessions/hello_world/tests.py +++ b/docs/quick_tour/sessions/hello_world/tests.py @@ -16,6 +16,12 @@ class ViewTests(unittest.TestCase): info = my_view(request) self.assertEqual(info['project'], 'hello_world') + def test_notfound_view(self): + from .views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + class FunctionalTests(unittest.TestCase): def setUp(self): @@ -27,3 +33,7 @@ class FunctionalTests(unittest.TestCase): def test_root(self): res = self.testapp.get('/', status=200) self.assertTrue(b'Pyramid' in res.body) + + def test_notfound(self): + res = self.testapp.get('/badurl', status=404) + self.assertTrue(res.status_code == 404) |
