﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32446	Deprecate the redundant SERIALIZE test database setting	Simon Charette	Simon Charette	"The [https://docs.djangoproject.com/en/3.1/ref/settings/#serialize 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` [https://docs.djangoproject.com/en/3.1/topics/testing/overview/#test-case-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)."	Cleanup/optimization	closed	Testing framework	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
