diff options
| author | Michael Merickel <michael@merickel.org> | 2020-01-03 23:14:53 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2020-01-03 23:14:53 -0600 |
| commit | 828e069de5d0c98e6d54cfdbf20b1a8acd1f6b39 (patch) | |
| tree | be692270de956199b4cfb1eda8a9fc24ceb8374e /docs/tutorials/wiki/tests.rst | |
| parent | 7820b922cc1b87147cc60288dff0bbdfd7b5bc8a (diff) | |
| parent | 148cf5138638ce6b1b92b4e13fe1444df9451e34 (diff) | |
| download | pyramid-828e069de5d0c98e6d54cfdbf20b1a8acd1f6b39.tar.gz pyramid-828e069de5d0c98e6d54cfdbf20b1a8acd1f6b39.tar.bz2 pyramid-828e069de5d0c98e6d54cfdbf20b1a8acd1f6b39.zip | |
Merge branch 'master' into security-docs
Diffstat (limited to 'docs/tutorials/wiki/tests.rst')
| -rw-r--r-- | docs/tutorials/wiki/tests.rst | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/tutorials/wiki/tests.rst b/docs/tutorials/wiki/tests.rst index 9dacc5f96..f710b3b10 100644 --- a/docs/tutorials/wiki/tests.rst +++ b/docs/tutorials/wiki/tests.rst @@ -4,7 +4,7 @@ Adding Tests ============ -We will now add tests for the models and the views and a few functional tests in ``tests.py``. +We will now add tests for the models and the views and a few functional tests in ``tests/test_it.py``. Tests ensure that an application works, and that it continues to work when changes are made in the future. @@ -12,10 +12,9 @@ Test the models =============== We write tests for the ``model`` classes and the ``appmaker``. -Changing ``tests.py``, we will write a separate test class for each ``model`` class +We will modify our ``test_it.py`` file, writing a separate test class for each ``model`` class. We will also write a test class for the ``appmaker``. -To do so, we will retain the ``tutorial.tests.ViewTests`` class that was generated from choosing the ``zodb`` backend option. We will add three test classes, one for each of the following: - the ``Page`` model named ``PageModelTests`` @@ -26,7 +25,7 @@ We will add three test classes, one for each of the following: Test the views ============== -We will modify our ``tests.py`` file, adding tests for each view function that we added previously. +We will modify our ``test_it.py`` file, adding tests for each view function that we added previously. As a result, we will delete the ``ViewTests`` class that the ``zodb`` backend option provided, and add four other test classes: ``ViewWikiTests``, ``ViewPageTests``, ``AddPageTests``, and ``EditPageTests``. These test the ``view_wiki``, ``view_page``, ``add_page``, and ``edit_page`` views. @@ -35,14 +34,15 @@ Functional tests ================ We will test the whole application, covering security aspects that are not tested in the unit tests, such as logging in, logging out, checking that the ``viewer`` user cannot add or edit pages, but the ``editor`` user can, and so on. +As a result we will add two test classes, ``SecurityTests`` and ``FunctionalTests``. -View the results of all our edits to ``tests.py`` -================================================= +View the results of all our edits to ``tests/test_it.py`` +========================================================= -Open the ``tutorial/tests.py`` module, and edit it such that it appears as follows: +Open the ``tests/test_it.py`` module, and edit it such that it appears as follows: -.. literalinclude:: src/tests/tutorial/tests.py +.. literalinclude:: src/tests/tests/test_it.py :linenos: :language: python |
