summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2012-03-13 17:18:13 -0700
committerChris McDonough <chrism@plope.com>2012-03-13 17:18:13 -0700
commite47a859a01927a5dca28d9830100dd0f30954a0e (patch)
tree4e247278a95b15e43620a8950cd51eb221e6de58 /docs/tutorials/wiki2
parent3c48872ca9f08bf87d2bf5df9516861216210a49 (diff)
parent3484f0c0fdbfc05ff9a289255c294379348beba5 (diff)
downloadpyramid-e47a859a01927a5dca28d9830100dd0f30954a0e.tar.gz
pyramid-e47a859a01927a5dca28d9830100dd0f30954a0e.tar.bz2
pyramid-e47a859a01927a5dca28d9830100dd0f30954a0e.zip
Merge pull request #478 from shentonfreude/shentonfreude/bug.sqltut-test-populate-settings
Shentonfreude/bug.sqltut test populate settings
Diffstat (limited to 'docs/tutorials/wiki2')
-rw-r--r--docs/tutorials/wiki2/tests.rst12
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``
====================================================