diff options
| author | Patricio Paez <pp@pp.com.mx> | 2012-03-14 12:45:43 -0700 |
|---|---|---|
| committer | Patricio Paez <pp@pp.com.mx> | 2012-03-14 12:45:43 -0700 |
| commit | 03bfabdc81c04ecf0fc9637056d7b1db189c6e0a (patch) | |
| tree | c29c488b89a0657d303ca2df2d1c6f608aa7d64b /docs/tutorials/wiki2/tests.rst | |
| parent | 95e70fb95b0783d380885d6c35d3925043f82531 (diff) | |
| parent | 34942793f03dea9d7f13b6e00d34946dee98d098 (diff) | |
| download | pyramid-03bfabdc81c04ecf0fc9637056d7b1db189c6e0a.tar.gz pyramid-03bfabdc81c04ecf0fc9637056d7b1db189c6e0a.tar.bz2 pyramid-03bfabdc81c04ecf0fc9637056d7b1db189c6e0a.zip | |
Merge branch 'master' into improve-docs
Diffstat (limited to 'docs/tutorials/wiki2/tests.rst')
| -rw-r--r-- | docs/tutorials/wiki2/tests.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/tutorials/wiki2/tests.rst b/docs/tutorials/wiki2/tests.rst index 92544404c..94d97d2d5 100644 --- a/docs/tutorials/wiki2/tests.rst +++ b/docs/tutorials/wiki2/tests.rst @@ -34,6 +34,18 @@ tested in the unit tests, like logging in, logging out, checking that the ``viewer`` user cannot add or edit pages, but the ``editor`` user can, and so on. +We must first modify ``main()`` in ``scripts/populate.py``, adding an +optional ``settings`` argument so we can pass in a URI to a +memory-resident database instead of our disk-based database we've +populated; this allows us to run our tests with a clean database each +time. Replace ``main()`` with this version which adds an argument and +then uses it if set, and creates a ``Model`` for testing: + +.. literalinclude:: src/tests/tutorial/scripts/populate.py + :lines: 24-36 + :linenos: + :language: python + Viewing the results of all our edits to ``tests.py`` ==================================================== |
