summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/tutorials/wiki2/tests.rst39
1 files changed, 25 insertions, 14 deletions
diff --git a/docs/tutorials/wiki2/tests.rst b/docs/tutorials/wiki2/tests.rst
index 67c7e65e0..e1f83a755 100644
--- a/docs/tutorials/wiki2/tests.rst
+++ b/docs/tutorials/wiki2/tests.rst
@@ -50,20 +50,36 @@ so on.
View the results of all our edits to ``tests`` subpackage
=========================================================
-Open ``tutorial/tests/test_views.py``, and edit it such that it appears as
-follows:
+Create ``tutorial/tests/test_views.py`` such that it appears as follows:
.. literalinclude:: src/tests/tutorial/tests/test_views.py
:linenos:
:language: python
-Open ``tutorial/tests/test_functional.py``, and edit it such that it appears as
-follows:
+Create ``tutorial/tests/test_functional.py`` such that it appears as follows:
.. literalinclude:: src/tests/tutorial/tests/test_functional.py
:linenos:
:language: python
+Create ``tutorial/tests/test_initdb.py`` such that it appears as follows:
+
+.. literalinclude:: src/tests/tutorial/tests/test_initdb.py
+ :linenos:
+ :language: python
+
+Create ``tutorial/tests/test_security.py`` such that it appears as follows:
+
+.. literalinclude:: src/tests/tutorial/tests/test_security.py
+ :linenos:
+ :language: python
+
+Create ``tutorial/tests/test_user_model.py`` such that it appears as follows:
+
+.. literalinclude:: src/tests/tutorial/tests/test_user_model.py
+ :linenos:
+ :language: python
+
.. note::
@@ -77,32 +93,27 @@ follows:
Running the tests
=================
-We can run these tests similarly to how we did in :ref:`running_tests`:
+We can run these tests similarly to how we did in :ref:`running_tests`, but first delete the SQLite database ``tutorial.sqlite``. If you do not delete the database, then you will see an integrity error when running the tests.
On UNIX:
.. code-block:: bash
+ $ rm tutorial.sqlite
$ $VENV/bin/py.test -q
On Windows:
.. code-block:: doscon
+ c:\tutorial> del tutorial.sqlite
c:\tutorial> %VENV%\Scripts\py.test -q
The expected result should look like the following:
.. code-block:: text
- ......................
- 22 passed, 1 pytest-warnings in 5.81 seconds
-
-.. note:: If you use Python 3 during this tutorial, you will see deprecation
- warnings in the output, which we will choose to ignore. In making this
- tutorial run on both Python 2 and 3, the authors prioritized simplicity and
- focus for the learner over accommodating warnings. In your own app or as
- extra credit, you may choose to either drop Python 2 support or hack your
- code to work without warnings on both Python 2 and 3.
+ ................................
+ 32 passed in 9.90 seconds
.. _webtest: http://docs.pylonsproject.org/projects/webtest/en/latest/