summaryrefslogtreecommitdiff
path: root/docs/narr/testing.rst
diff options
context:
space:
mode:
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.