diff options
| author | Steve Piercy <web@stevepiercy.com> | 2019-12-27 14:39:58 -0800 |
|---|---|---|
| committer | Steve Piercy <web@stevepiercy.com> | 2020-01-02 23:30:59 -0800 |
| commit | f179c23c705afc20026c26bd02d6ae64b8295935 (patch) | |
| tree | c80684d088b1562d907dcedd143854f7166b57db | |
| parent | 1ca5432b80167f2da57c54e5050b977da9e191ed (diff) | |
| download | pyramid-f179c23c705afc20026c26bd02d6ae64b8295935.tar.gz pyramid-f179c23c705afc20026c26bd02d6ae64b8295935.tar.bz2 pyramid-f179c23c705afc20026c26bd02d6ae64b8295935.zip | |
Update quick_tutorial/cookiecutters.rst and related files
5 files changed, 15 insertions, 5 deletions
diff --git a/docs/quick_tutorial/cookiecutters.rst b/docs/quick_tutorial/cookiecutters.rst index e4a585a33..a1d60c181 100644 --- a/docs/quick_tutorial/cookiecutters.rst +++ b/docs/quick_tutorial/cookiecutters.rst @@ -73,8 +73,8 @@ Steps .. code-block:: text - Starting subprocess with file monitor - Starting server in PID 73732. + Starting monitor for PID 60461. + Starting server in PID 60461. Serving on http://localhost:6543 Serving on http://localhost:6543 diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/tests.py b/docs/quick_tutorial/cookiecutters/cc_starter/tests.py index f3886be84..0891a3c51 100644 --- a/docs/quick_tutorial/cookiecutters/cc_starter/tests.py +++ b/docs/quick_tutorial/cookiecutters/cc_starter/tests.py @@ -16,6 +16,12 @@ class ViewTests(unittest.TestCase): info = my_view(request) self.assertEqual(info['project'], 'cc_starter') + 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_tutorial/cookiecutters/cc_starter/views/default.py b/docs/quick_tutorial/cookiecutters/cc_starter/views/default.py index 47af359b5..21c30e0b2 100644 --- a/docs/quick_tutorial/cookiecutters/cc_starter/views/default.py +++ b/docs/quick_tutorial/cookiecutters/cc_starter/views/default.py @@ -1,6 +1,6 @@ from pyramid.view import view_config -@view_config(route_name='home', renderer='../templates/mytemplate.jinja2') +@view_config(route_name='home', renderer='cc_starter:templates/mytemplate.jinja2') def my_view(request): return {'project': 'cc_starter'} diff --git a/docs/quick_tutorial/cookiecutters/cc_starter/views/notfound.py b/docs/quick_tutorial/cookiecutters/cc_starter/views/notfound.py index 69d6e2804..e8b8f26f3 100644 --- a/docs/quick_tutorial/cookiecutters/cc_starter/views/notfound.py +++ b/docs/quick_tutorial/cookiecutters/cc_starter/views/notfound.py @@ -1,7 +1,7 @@ from pyramid.view import notfound_view_config -@notfound_view_config(renderer='../templates/404.jinja2') +@notfound_view_config(renderer='cc_starter:templates/404.jinja2') def notfound_view(request): request.response.status = 404 return {} diff --git a/docs/quick_tutorial/cookiecutters/pytest.ini b/docs/quick_tutorial/cookiecutters/pytest.ini index a7bd797f0..326c14fbc 100644 --- a/docs/quick_tutorial/cookiecutters/pytest.ini +++ b/docs/quick_tutorial/cookiecutters/pytest.ini @@ -1,3 +1,3 @@ [pytest] testpaths = cc_starter -python_files = *.py +python_files = test*.py |
