summaryrefslogtreecommitdiff
path: root/docs/narr/testing.rst
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2020-01-03 23:14:26 -0600
committerGitHub <noreply@github.com>2020-01-03 23:14:26 -0600
commit148cf5138638ce6b1b92b4e13fe1444df9451e34 (patch)
tree7b088836b570b401caf510f130f144404cb19ca4 /docs/narr/testing.rst
parentcc396692d82441f8142fb14041542ebd2dad6f0a (diff)
parentb349c2ba948148d2f5441308c6646f624100b364 (diff)
downloadpyramid-148cf5138638ce6b1b92b4e13fe1444df9451e34.tar.gz
pyramid-148cf5138638ce6b1b92b4e13fe1444df9451e34.tar.bz2
pyramid-148cf5138638ce6b1b92b4e13fe1444df9451e34.zip
Merge pull request #3556 from stevepiercy/docs-synch-cookiecutter-pr-71
Update docs to sync with cookiecutter master branch
Diffstat (limited to 'docs/narr/testing.rst')
-rw-r--r--docs/narr/testing.rst19
1 files changed, 10 insertions, 9 deletions
diff --git a/docs/narr/testing.rst b/docs/narr/testing.rst
index 2182082a8..0fa1e98fd 100644
--- a/docs/narr/testing.rst
+++ b/docs/narr/testing.rst
@@ -403,20 +403,21 @@ function ``my_view`` that returns an HTML body when the root URL is invoked:
:linenos:
:language: python
-The following example functional test demonstrates invoking the above
-:term:`view`:
+The following example functional tests demonstrate invoking the above :term:`view`:
- .. literalinclude:: myproject/myproject/tests.py
+ .. literalinclude:: myproject/tests/test_it.py
:linenos:
:pyobject: FunctionalTests
:language: python
-When this test is run, each test method creates a "real" :term:`WSGI`
-application using the ``main`` function in your ``myproject.__init__`` module,
-using :term:`WebTest` to wrap that WSGI application. It assigns the result to
-``self.testapp``. In the test named ``test_root``, the ``TestApp``'s ``GET``
-method is used to invoke the root URL. Finally, an assertion is made that the
-returned HTML contains the text ``Pyramid``.
+When these tests are run, each test method creates a "real" :term:`WSGI` application using the ``main`` function in your ``myproject.__init__`` module, using :term:`WebTest` to wrap that WSGI application.
+It assigns the result to ``self.testapp``.
+
+In the test named ``test_root``, the ``TestApp``'s ``GET`` method is used to invoke the root URL.
+An assertion is made that the returned HTML contains the text ``Pyramid``.
+
+In the test named ``test_notfound``, the ``TestApp``'s ``GET`` method is used to invoke a bad URL ``/badurl``.
+An assertion is made that the returned status code in the response is ``404``.
See the :term:`WebTest` documentation for further information about the methods
available to a :class:`webtest.app.TestApp` instance.