mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Fixed #27061 -- Added a TEST['TEMPLATE'] setting for PostgreSQL.
This commit is contained in:
parent
bc1e2d8e8e
commit
a3db480393
5 changed files with 98 additions and 10 deletions
|
@ -164,6 +164,16 @@ lookups that use the ``LIKE`` operator in their SQL, as is done with the
|
|||
|
||||
.. _PostgreSQL operator class: http://www.postgresql.org/docs/current/static/indexes-opclass.html
|
||||
|
||||
Test database templates
|
||||
-----------------------
|
||||
|
||||
.. versionadded:: 1.11
|
||||
|
||||
You can use the :setting:`TEST['TEMPLATE'] <TEST_TEMPLATE>` setting to specify
|
||||
a `template`_ (e.g. ``'template0'``) from which to create a test database.
|
||||
|
||||
.. _template: https://www.postgresql.org/docs/current/static/sql-createdatabase.html
|
||||
|
||||
Speeding up test execution with non-durable settings
|
||||
----------------------------------------------------
|
||||
|
||||
|
|
|
@ -738,6 +738,20 @@ the database state between tests if you don't have transactions). You can set
|
|||
this to ``False`` to speed up creation time if you don't have any test classes
|
||||
with :ref:`serialized_rollback=True <test-case-serialized-rollback>`.
|
||||
|
||||
.. setting:: TEST_TEMPLATE
|
||||
|
||||
``TEMPLATE``
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. versionadded:: 1.11
|
||||
|
||||
This is a PostgreSQL-specific setting.
|
||||
|
||||
The name of a `template`_ (e.g. ``'template0'``) from which to create the test
|
||||
database.
|
||||
|
||||
.. _template: https://www.postgresql.org/docs/current/static/sql-createdatabase.html
|
||||
|
||||
.. setting:: TEST_CREATE
|
||||
|
||||
``CREATE_DB``
|
||||
|
|
|
@ -159,6 +159,9 @@ Database backends
|
|||
on PostgreSQL 9.5+ and Oracle to execute queries with
|
||||
``FOR UPDATE SKIP LOCKED``.
|
||||
|
||||
* Added the :setting:`TEST['TEMPLATE'] <TEST_TEMPLATE>` setting to let
|
||||
PostgreSQL users specify a template for creating the test database.
|
||||
|
||||
Email
|
||||
~~~~~
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue