mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Fixed #20550 -- Added ability to preserve test db between runs
This commit is contained in:
parent
2e613ea5c5
commit
b7aa7c4ab4
10 changed files with 70 additions and 18 deletions
|
@ -149,6 +149,14 @@ Tests that require a database (namely, model tests) will not use your "real"
|
|||
Regardless of whether the tests pass or fail, the test databases are destroyed
|
||||
when all the tests have been executed.
|
||||
|
||||
.. versionadded:: 1.8
|
||||
|
||||
You can prevent the test databases from being destroyed by adding the
|
||||
:djadminopt:`--keepdb` flag to the test command. This will preserve the test
|
||||
database between runs. If the database does not exist, it will first
|
||||
be created. Any migrations will also be applied in order to keep it
|
||||
up to date.
|
||||
|
||||
By default the test databases get their names by prepending ``test_``
|
||||
to the value of the :setting:`NAME` settings for the databases
|
||||
defined in :setting:`DATABASES`. When using the SQLite database engine
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue