summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2/tests.rst
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2015-12-02 04:18:10 -0800
committerSteve Piercy <web@stevepiercy.com>2015-12-02 04:18:10 -0800
commitf10fb24a3663cb070b28b8020fde957d16563400 (patch)
tree6a17e57e989085eabe45325a0816bec1a0c9593c /docs/tutorials/wiki2/tests.rst
parentfe4465b91296ca7d41c4f7c8006cbd8d50851a09 (diff)
downloadpyramid-f10fb24a3663cb070b28b8020fde957d16563400.tar.gz
pyramid-f10fb24a3663cb070b28b8020fde957d16563400.tar.bz2
pyramid-f10fb24a3663cb070b28b8020fde957d16563400.zip
- rewrite wiki2/tests.rst (removed an obsolete reference to testing models, per 2885a7b96545c037109d7999319f74869a640050)
- add wiki2/src/tests/ files. special thanks to @ppaez
Diffstat (limited to 'docs/tutorials/wiki2/tests.rst')
-rw-r--r--docs/tutorials/wiki2/tests.rst26
1 files changed, 8 insertions, 18 deletions
diff --git a/docs/tutorials/wiki2/tests.rst b/docs/tutorials/wiki2/tests.rst
index 64025421f..fe3fdaf2c 100644
--- a/docs/tutorials/wiki2/tests.rst
+++ b/docs/tutorials/wiki2/tests.rst
@@ -11,17 +11,12 @@ is a common practice to put tests into a ``tests`` subpackage, especially as
projects grow in size and complexity. Each module in the test subpackage
should contain tests for its corresponding module in our application. Each
corresponding pair of modules should have the same names, except the test
-module should have the prefix "test_".
+module should have the prefix ``test_``.
We will move parts of ``tests.py`` into appropriate new files in the ``tests``
subpackage, and add several new tests.
-
-Test the models
-===============
-
-To test the model class ``Page``, we'll add a new ``PageModelTests`` class to
-a new file ``tests/test_models.py``
+Start by creating a new directory and a new empty file ``tests/__init__.py``.
Test the views
@@ -47,13 +42,6 @@ can, and so on.
View the results of all our edits to ``tests`` subpackage
=========================================================
-Open ``tutorial/tests/test_models.py``, and edit it such that it appears as
-follows:
-
-.. literalinclude:: src/tests/tutorial/tests/test_models.py
- :linenos:
- :language: python
-
Open ``tutorial/tests/test_views.py``, and edit it such that it appears as
follows:
@@ -61,10 +49,10 @@ follows:
:linenos:
:language: python
-Open ``tutorial/tests/test_.py``, and edit it such that it appears as
+Open ``tutorial/tests/test_functional.py``, and edit it such that it appears as
follows:
-.. literalinclude:: src/tests/tutorial/tests/test_.py
+.. literalinclude:: src/tests/tutorial/tests/test_functional.py
:linenos:
:language: python
@@ -119,8 +107,10 @@ The expected result should look like the following:
.. code-block:: text
- ......................
+ ....................
----------------------------------------------------------------------
- Ran 21 tests in 2.700s
+ Ran 20 tests in 0.524s
OK
+
+ Process finished with exit code 0