summaryrefslogtreecommitdiff
path: root/docs/narr/myproject
diff options
context:
space:
mode:
Diffstat (limited to 'docs/narr/myproject')
-rw-r--r--docs/narr/myproject/README.txt4
-rw-r--r--docs/narr/myproject/myproject/tests.py12
-rw-r--r--docs/narr/myproject/myproject/views/default.py2
-rw-r--r--docs/narr/myproject/myproject/views/notfound.py2
-rw-r--r--docs/narr/myproject/pytest.ini2
-rw-r--r--docs/narr/myproject/setup.py2
6 files changed, 17 insertions, 7 deletions
diff --git a/docs/narr/myproject/README.txt b/docs/narr/myproject/README.txt
index 2ffc0acba..6c5a0fee0 100644
--- a/docs/narr/myproject/README.txt
+++ b/docs/narr/myproject/README.txt
@@ -1,4 +1,4 @@
-MyProject
+myproject
=========
Getting Started
@@ -6,7 +6,7 @@ Getting Started
- Change directory into your newly created project.
- cd MyProject
+ cd myproject
- Create a Python virtual environment.
diff --git a/docs/narr/myproject/myproject/tests.py b/docs/narr/myproject/myproject/tests.py
index 05ccadcfb..48f0095ad 100644
--- a/docs/narr/myproject/myproject/tests.py
+++ b/docs/narr/myproject/myproject/tests.py
@@ -14,7 +14,13 @@ class ViewTests(unittest.TestCase):
from .views.default import my_view
request = testing.DummyRequest()
info = my_view(request)
- self.assertEqual(info['project'], 'MyProject')
+ self.assertEqual(info['project'], 'myproject')
+
+ 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):
@@ -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/narr/myproject/myproject/views/default.py b/docs/narr/myproject/myproject/views/default.py
index 8324cfe32..619ce1c0f 100644
--- a/docs/narr/myproject/myproject/views/default.py
+++ b/docs/narr/myproject/myproject/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='myproject:templates/mytemplate.jinja2')
def my_view(request):
return {'project': 'myproject'}
diff --git a/docs/narr/myproject/myproject/views/notfound.py b/docs/narr/myproject/myproject/views/notfound.py
index 69d6e2804..5abebb277 100644
--- a/docs/narr/myproject/myproject/views/notfound.py
+++ b/docs/narr/myproject/myproject/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='myproject:templates/404.jinja2')
def notfound_view(request):
request.response.status = 404
return {}
diff --git a/docs/narr/myproject/pytest.ini b/docs/narr/myproject/pytest.ini
index b1b5f4c38..332cf0d04 100644
--- a/docs/narr/myproject/pytest.ini
+++ b/docs/narr/myproject/pytest.ini
@@ -1,3 +1,3 @@
[pytest]
testpaths = myproject
-python_files = *.py
+python_files = test*.py
diff --git a/docs/narr/myproject/setup.py b/docs/narr/myproject/setup.py
index 1ee272270..40aa2c53b 100644
--- a/docs/narr/myproject/setup.py
+++ b/docs/narr/myproject/setup.py
@@ -25,7 +25,7 @@ tests_require = [
setup(
name='myproject',
version='0.0',
- description='MyProject',
+ description='myproject',
long_description=README + '\n\n' + CHANGES,
classifiers=[
'Programming Language :: Python',