diff --git a/docs/ref/migration-operations.txt b/docs/ref/migration-operations.txt index 95c9a65020..980b26cdbd 100644 --- a/docs/ref/migration-operations.txt +++ b/docs/ref/migration-operations.txt @@ -239,7 +239,7 @@ set ``atomic=False``. .. warning:: - RunPython does not magically alter the connection of the models for you; + ``RunPython`` does not magically alter the connection of the models for you; any model methods you call will go to the default database unless you give them the current database alias (available from ``schema_editor.connection.alias``, where ``schema_editor`` is the second diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 7f41939735..01d052d413 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -2121,17 +2121,19 @@ The name of the class to use for starting the test suite. See TEST_NON_SERIALIZED_APPS ------------------------ +.. versionadded:: 1.7 + Default: ``[]`` -In order to restore the database state between tests for TransactionTestCases -and database backends without transactions, Django will :ref:`serialize the -contents of all apps with migrations ` when it -starts the test run so it can then reload from that copy before tests that -need it. +In order to restore the database state between tests for +``TransactionTestCase``\s and database backends without transactions, Django +will :ref:`serialize the contents of all apps with migrations +` when it starts the test run so it can then +reload from that copy before tests that need it. This slows down the startup time of the test runner; if you have apps that you know don't need this feature, you can add their full names in here (e.g. -``django.contrib.contenttypes``) to exclude them from this serialization +``'django.contrib.contenttypes'``) to exclude them from this serialization process. .. setting:: THOUSAND_SEPARATOR @@ -3120,6 +3122,7 @@ Templates Testing ------- * Database: :setting:`TEST ` +* :setting:`TEST_NON_SERIALIZED_APPS` * :setting:`TEST_RUNNER` URLs diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index 9588ac3be1..d70c40a057 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -63,9 +63,10 @@ but a few of the key features are: * ``initial_data`` fixtures are no longer loaded for apps with migrations; if you want to load initial data for an app, we suggest you do it in a migration. -* Test rollback behaviour is different for apps with migrations; in particular, +* Test rollback behavior is different for apps with migrations; in particular, Django will no longer emulate rollbacks on non-transactional databases or - inside ``TransactionTestCase`` :ref:`unless specifically asked `. + inside ``TransactionTestCase`` :ref:`unless specifically requested + `. App-loading refactor ~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/spelling_wordlist b/docs/spelling_wordlist index fbe5dfa2a5..7ba6399fb8 100644 --- a/docs/spelling_wordlist +++ b/docs/spelling_wordlist @@ -635,6 +635,8 @@ ubuntu Ubuntuusers ul umask +unassigning +unapplied unapply unapplying uncheck diff --git a/docs/topics/testing/advanced.txt b/docs/topics/testing/advanced.txt index 5a991598d0..ae0e78ce8e 100644 --- a/docs/topics/testing/advanced.txt +++ b/docs/topics/testing/advanced.txt @@ -504,12 +504,11 @@ can be useful during testing. * If autoclobber is ``True``, the database will be destroyed without consulting the user. - ``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. + data persistence outside of test fixtures. Returns the name of the test database that it created. @@ -517,6 +516,10 @@ can be useful during testing. :setting:`NAME` in :setting:`DATABASES` to match the name of the test database. + .. versionchanged:: 1.7 + + The ``serialize`` argument was added. + .. function:: destroy_test_db(old_database_name, [verbosity=1]) Destroys the database whose name is the value of :setting:`NAME` in diff --git a/docs/topics/testing/overview.txt b/docs/topics/testing/overview.txt index 0fa158172d..1c3b6d5df6 100644 --- a/docs/topics/testing/overview.txt +++ b/docs/topics/testing/overview.txt @@ -251,7 +251,7 @@ tests and not in ``TransactionTestCase`` tests, and additionally only on backends where transactions are supported (the most important exception being MyISAM). -Django can re-load that data for you on a per-testcase basis by +Django can reload that data for you on a per-testcase basis by setting the ``serialized_rollback`` option to ``True`` in the body of the ``TestCase`` or ``TransactionTestCase``, but note that this will slow down that test suite by approximately 3x. @@ -283,7 +283,6 @@ used. This behavior `may change`_ in the future. .. _may change: https://code.djangoproject.com/ticket/11505 - Understanding the test output -----------------------------