summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2/tests.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/wiki2/tests.rst')
-rw-r--r--docs/tutorials/wiki2/tests.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/tutorials/wiki2/tests.rst b/docs/tutorials/wiki2/tests.rst
index 1bf38d988..4ea2e2e15 100644
--- a/docs/tutorials/wiki2/tests.rst
+++ b/docs/tutorials/wiki2/tests.rst
@@ -63,12 +63,12 @@ Per-test fixtures
The ``testapp`` is able to mutate the request environ such that the ``dbsession`` and ``tm`` fixtures are injected and used by any code that's touching ``request.dbsession`` and ``request.tm``.
The ``testapp`` maintains a cookiejar, so it can be used to share state across requests, as well as the transaction database connection.
-- ``app_request`` - a :class:`pyramid.request.Request` object that can be used for more lightweight tests versus the full ``testapp``.
- The ``app_request`` can be passed to view functions and other code that need a fully functional request object.
-
- ``dummy_request`` - a :class:`pyramid.testing.DummyRequest` object that is very lightweight.
This is a great object to pass to view functions that have minimal side-effects as it'll be fast and simple.
+- ``dummy_config`` — a :class:`pyramid.config.Configurator` object used as configuration by ``dummy_request``.
+ Useful for mocking configuration like routes and security policies.
+
Modifying the fixtures
----------------------
@@ -109,8 +109,8 @@ Integration tests
=================
We can directly execute the view code, bypassing :app:`Pyramid` and testing just the code that we've written.
-These tests use dummy requests that we'll prepare appropriately to set the conditions each view expects.
-For example, setting ``request.user``, or adding some dummy data to the session.
+These tests use dummy requests that we'll prepare appropriately to set the conditions each view expects, such as adding dummy data to the session.
+We'll be using ``dummy_config`` to configure the necessary routes, as well as setting the security policy as :class:`pyramid.testing.DummySecurityPolicy` to mock ``dummy_request.identity``.
Update ``tests/test_views.py`` such that it appears as follows: