Skip to content

Commit

Permalink
Merge pull request #478 from shentonfreude/shentonfreude/bug.sqltut-t…
Browse files Browse the repository at this point in the history
…est-populate-settings

Shentonfreude/bug.sqltut test populate settings
  • Loading branch information
mcdonc committed Mar 14, 2012
2 parents 3c48872 + 3484f0c commit e47a859
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/tutorials/wiki2/tests.rst
Expand Up @@ -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``
====================================================

Expand Down

0 comments on commit e47a859

Please sign in to comment.