From b3b1d3d45fc066367f4fcacf0b06f72fcd00a9c6 Mon Sep 17 00:00:00 2001 From: romgar Date: Mon, 7 Nov 2016 22:08:40 +0000 Subject: Fixed #25251 -- Made data migrations available in TransactionTestCase when using --keepdb. Data loaded in migrations were restored at the beginning of each TransactionTestCase and all the tables are truncated at the end of these test cases. If there was a TransactionTestCase at the end of the test suite, the migrated data weren't restored in the database (especially unexpected when using --keepdb). Now data is restored at the end of each TransactionTestCase. --- docs/ref/settings.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index dd65e451c2..a3f6f421dd 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -777,6 +777,11 @@ 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 `. +Don't set this to ``False`` if you want to use :option:`test --keepdb` +and your test suite contains :class:`~django.test.TransactionTestCase` or +doesn't support transactions, as this in-memory JSON string is used to restore +the initial data migrations in these situations. + .. setting:: TEST_TEMPLATE ``TEMPLATE`` -- cgit v1.3