summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-06-09 11:12:28 -0400
committerTim Graham <timograham@gmail.com>2014-06-09 11:12:28 -0400
commit3a926c077863f0491ef66edbe451ee67c8fe59df (patch)
treedd108baa9e32e548b3766a868240e2f675650530 /docs
parent67ce2e74e1aafd3f85f6d64059d204e434e0e5f4 (diff)
Tweaked order of create_test_db arguments for backwards compatibility.
Since `serialize` was backported to 1.7, it should appear before `keepdb`.
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/testing/advanced.txt26
1 files changed, 19 insertions, 7 deletions
diff --git a/docs/topics/testing/advanced.txt b/docs/topics/testing/advanced.txt
index 7c8124052d..8e9337b9b4 100644
--- a/docs/topics/testing/advanced.txt
+++ b/docs/topics/testing/advanced.txt
@@ -485,7 +485,7 @@ django.db.connection.creation
The creation module of the database backend also provides some utilities that
can be useful during testing.
-.. function:: create_test_db([verbosity=1, autoclobber=False, keepdb=False, serialize=True])
+.. function:: create_test_db([verbosity=1, autoclobber=False, serialize=True, keepdb=False])
Creates a new test database and runs ``migrate`` against it.
@@ -501,24 +501,32 @@ can be useful during testing.
* If autoclobber is ``True``, the database will be destroyed
without consulting the user.
- ``keepdb`` determines if the test run should use an existing
- database, or create a new one. If ``True``, the existing
- database will be used, or created if not present. If ``False``,
- a new database will be created, prompting the user to remove
- the existing one, if present.
-
``serialize`` determines if Django serializes the database into an
in-memory JSON string before running tests (used to restore the database
state between tests if you don't have transactions). You can set this to
False to significantly speed up creation time if you know you don't need
data persistance outside of test fixtures.
+ ``keepdb`` determines if the test run should use an existing
+ database, or create a new one. If ``True``, the existing
+ database will be used, or created if not present. If ``False``,
+ a new database will be created, prompting the user to remove
+ the existing one, if present.
+
Returns the name of the test database that it created.
``create_test_db()`` has the side effect of modifying the value of
:setting:`NAME` in :setting:`DATABASES` to match the name of the test
database.
+ .. versionchanged:: 1.7
+
+ The ``serialize`` argument was added.
+
+ .. versionchanged:: 1.8
+
+ The ``keepdb`` argument was added.
+
.. function:: destroy_test_db(old_database_name, [verbosity=1, keepdb=False])
Destroys the database whose name is the value of :setting:`NAME` in
@@ -531,6 +539,10 @@ can be useful during testing.
If the ``keepdb`` argument is ``True``, then the connection to the
database will be closed, but the database will not be destroyed.
+ .. versionchanged:: 1.8
+
+ The ``keepdb`` argument was added.
+
.. _topics-testing-code-coverage:
Integration with coverage.py