1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #32446 -- Removed SERIALIZE test database setting per deprecation timeline.

This commit is contained in:
Mariusz Felisiak
2023-01-06 09:28:25 +01:00
parent 490cccbe7e
commit 6c0539ed7c
6 changed files with 7 additions and 70 deletions

View File

@@ -819,7 +819,7 @@ class AliasedDefaultTestSetupTest(unittest.TestCase):
runner_instance.teardown_databases(old_config)
class SetupDatabasesTests(SimpleTestCase):
class SetupDatabasesTests(unittest.TestCase):
def setUp(self):
self.runner_instance = DiscoverRunner(verbosity=0)
@@ -912,30 +912,6 @@ class SetupDatabasesTests(SimpleTestCase):
verbosity=0, autoclobber=False, serialize=True, keepdb=False
)
def test_serialized_off(self):
tested_connections = db.ConnectionHandler(
{
"default": {
"ENGINE": "django.db.backends.dummy",
"TEST": {"SERIALIZE": False},
},
}
)
msg = (
"The SERIALIZE test database setting is deprecated as it can be "
"inferred from the TestCase/TransactionTestCase.databases that "
"enable the serialized_rollback feature."
)
with mock.patch(
"django.db.backends.dummy.base.DatabaseWrapper.creation_class"
) as mocked_db_creation:
with mock.patch("django.test.utils.connections", new=tested_connections):
with self.assertWarnsMessage(RemovedInDjango50Warning, msg):
self.runner_instance.setup_databases()
mocked_db_creation.return_value.create_test_db.assert_called_once_with(
verbosity=0, autoclobber=False, serialize=False, keepdb=False
)
@skipUnlessDBFeature("supports_sequence_reset")
class AutoIncrementResetTest(TransactionTestCase):