Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Show modification to scripts/ to accept memory DB URI

The text didn't describe editing the to accept an optional
``settings`` argument, which _callFUT() in passed in. This is
used to specify a memory-backed SQLite DB which we can wipe-n-load
during testing.

Show how to replace main() in per our source code to
accept this argument, and use it to set the DB URI; it also uses our
Page model.
  • Loading branch information...
commit 1e5ba8a07c583073f1d885156c92a266ceb8dce9 1 parent 352f6ad
@shentonfreude shentonfreude authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 docs/tutorials/wiki2/tests.rst
12 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/``, 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/
+ :lines: 24-36
+ :linenos:
+ :language: python
Viewing the results of all our edits to ````
Please sign in to comment.
Something went wrong with that request. Please try again.