1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #12118 -- Added shared cache support to SQLite in-memory testing.

This commit is contained in:
Andriy Sokolovskiy
2014-12-04 01:17:59 +02:00
committed by Tim Graham
parent fca866763a
commit 8c99b7920e
6 changed files with 62 additions and 10 deletions

View File

@@ -185,12 +185,20 @@ control the particular collation used by the test database. See the
:doc:`settings documentation </ref/settings>` for details of these
and other advanced settings.
If using a SQLite in-memory database with Python 3.4+ and SQLite 3.7.13+,
`shared cache <https://www.sqlite.org/sharedcache.html>`_ will be enabled, so
you can write tests with ability to share the database between threads.
.. versionchanged:: 1.7
The different options in the :setting:`TEST <DATABASE-TEST>` database
setting used to be separate options in the database settings dictionary,
prefixed with ``TEST_``.
.. versionadded:: 1.8
The ability to use SQLite with a shared cache as described above was added.
.. admonition:: Finding data from your production database when running tests?
If your code attempts to access the database when its modules are compiled,