summaryrefslogtreecommitdiff
path: root/docs/quick_tutorial
diff options
context:
space:
mode:
Diffstat (limited to 'docs/quick_tutorial')
-rw-r--r--docs/quick_tutorial/cookiecutters.rst4
-rw-r--r--docs/quick_tutorial/cookiecutters/cc_starter/tests.py10
-rw-r--r--docs/quick_tutorial/cookiecutters/cc_starter/views/default.py2
-rw-r--r--docs/quick_tutorial/cookiecutters/cc_starter/views/notfound.py2
-rw-r--r--docs/quick_tutorial/cookiecutters/pytest.ini2
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