Deprecate the redundant SERIALIZE test database setting
The SERIALIZE test database setting controls whether or not the content of test databases state should be serialized and restored between tests which enables the TransactionTestCase.serialized_rollback
feature. It defaults to True
and the documentation encourage turning it off to speed up test database creation time.
The requirements of having TransactionTestCase
subclasses declare databases they are allowed to interact with that was introduced by #28478 paired with the requirement to opt-in the serialization behaviour through serialized_rollback=False
allows the suite to determine if data state serialization for each test database is necessary at discovery time which makes the setting unnecessary.
I therefore suggest we deprecate the SERIALIZE
test database and base per-database serialization on the subset of discovered TransactionTestCase.databases
declared with serialized_rollback = True
. This should change the default to avoiding unnecessary state serialization of test databases which can add up pretty quickly in large Django projects with a lot of apps and models (one unnecessary query for each model present).
Change History
(8)
Description: |
modified (diff)
|
Owner: |
changed from nobody to Simon Charette
|
Triage Stage: |
Unreviewed → Accepted
|
Has patch: |
set
|
Needs documentation: |
set
|
Needs tests: |
set
|
Patch needs improvement: |
set
|
Needs documentation: |
unset
|
Needs tests: |
unset
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
PR