mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
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.
This commit is contained in:
@@ -298,6 +298,17 @@ Database backend API
|
||||
|
||||
* Support for GDAL 1.9 and 1.10 is dropped.
|
||||
|
||||
``TransactionTestCase`` serialized data loading
|
||||
-----------------------------------------------
|
||||
|
||||
Initial data migrations are now loaded in
|
||||
:class:`~django.test.TransactionTestCase` at the end of the test, after the
|
||||
database flush. In older versions, this data was loaded at the beginning of the
|
||||
test, but this prevents the :option:`test --keepdb` option from working
|
||||
properly (the database was empty at the end of the whole test suite). This
|
||||
change shouldn't have an impact on your tests unless you've customized
|
||||
:class:`~django.test.TransactionTestCase`'s internals.
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user