From f61a292939d2a41598f45fc8f908343eb8859e23 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 27 Dec 2019 02:47:04 -0800 Subject: Update tests.py with 100% coverage --- docs/quick_tour/package/hello_world/tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/quick_tour/package') 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) -- cgit v1.2.3