summaryrefslogtreecommitdiff
path: root/docs/narr/myproject
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2019-12-27 04:01:17 -0800
committerSteve Piercy <web@stevepiercy.com>2020-01-02 23:30:59 -0800
commit1ca5432b80167f2da57c54e5050b977da9e191ed (patch)
treef7c0cd7eb3d9d66c5745063dac86f33aac33e7b0 /docs/narr/myproject
parentf61a292939d2a41598f45fc8f908343eb8859e23 (diff)
downloadpyramid-1ca5432b80167f2da57c54e5050b977da9e191ed.tar.gz
pyramid-1ca5432b80167f2da57c54e5050b977da9e191ed.tar.bz2
pyramid-1ca5432b80167f2da57c54e5050b977da9e191ed.zip
Update project.rst and its cookiecutter project files
- Update output to reflect current cookiecutter - Fix minor typos - Use new links to PyPA for MANIFEST.in description and usage - Add missing keyword "keywords" to setup.py whirlwind description - Flip order of `install_requires` and `extras_require` to align with order in setup.py - Update line numbers and code references - Add watchman under hupper and rewrite paragraph @mmerickel should review
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',