summaryrefslogtreecommitdiff
path: root/docs/quick_tour/package/hello_world
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2020-01-03 23:14:53 -0600
committerMichael Merickel <michael@merickel.org>2020-01-03 23:14:53 -0600
commit828e069de5d0c98e6d54cfdbf20b1a8acd1f6b39 (patch)
treebe692270de956199b4cfb1eda8a9fc24ceb8374e /docs/quick_tour/package/hello_world
parent7820b922cc1b87147cc60288dff0bbdfd7b5bc8a (diff)
parent148cf5138638ce6b1b92b4e13fe1444df9451e34 (diff)
downloadpyramid-828e069de5d0c98e6d54cfdbf20b1a8acd1f6b39.tar.gz
pyramid-828e069de5d0c98e6d54cfdbf20b1a8acd1f6b39.tar.bz2
pyramid-828e069de5d0c98e6d54cfdbf20b1a8acd1f6b39.zip
Merge branch 'master' into security-docs
Diffstat (limited to 'docs/quick_tour/package/hello_world')
-rw-r--r--docs/quick_tour/package/hello_world/tests.py29
-rw-r--r--docs/quick_tour/package/hello_world/views/default.py2
-rw-r--r--docs/quick_tour/package/hello_world/views/notfound.py2
3 files changed, 2 insertions, 31 deletions
diff --git a/docs/quick_tour/package/hello_world/tests.py b/docs/quick_tour/package/hello_world/tests.py
deleted file mode 100644
index f01ae2a3c..000000000
--- a/docs/quick_tour/package/hello_world/tests.py
+++ /dev/null
@@ -1,29 +0,0 @@
-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.default import my_view
- request = testing.DummyRequest()
- info = my_view(request)
- self.assertEqual(info['project'], 'hello_world')
-
-
-class FunctionalTests(unittest.TestCase):
- def setUp(self):
- from hello_world import main
- app = main({})
- from webtest import TestApp
- self.testapp = TestApp(app)
-
- def test_root(self):
- res = self.testapp.get('/', status=200)
- self.assertTrue(b'Pyramid' in res.body)
diff --git a/docs/quick_tour/package/hello_world/views/default.py b/docs/quick_tour/package/hello_world/views/default.py
index 7458da006..000a66e2e 100644
--- a/docs/quick_tour/package/hello_world/views/default.py
+++ b/docs/quick_tour/package/hello_world/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='hello_world:templates/mytemplate.jinja2')
def my_view(request):
return {'project': 'hello_world'}
diff --git a/docs/quick_tour/package/hello_world/views/notfound.py b/docs/quick_tour/package/hello_world/views/notfound.py
index 69d6e2804..6d0ff4193 100644
--- a/docs/quick_tour/package/hello_world/views/notfound.py
+++ b/docs/quick_tour/package/hello_world/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='hello_world:templates/404.jinja2')
def notfound_view(request):
request.response.status = 404
return {}