From 2a2ea4ee18fdcf2c95bf6435bc63b74623e3085b Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 20 Dec 2019 20:49:56 +0100 Subject: Refs #31117 -- Made various tests properly handle unexpected databases aliases. - Used selected "databases" instead of django.db.connections. - Made routers in tests.migrations skip migrations on unexpected databases. - Added DiscoverRunnerGetDatabasesTests.assertSkippedDatabases() hook which properly asserts messages about skipped databases. --- tests/migrations/test_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/migrations/test_base.py') diff --git a/tests/migrations/test_base.py b/tests/migrations/test_base.py index 45c5472b0f..c4c8b1ee6c 100644 --- a/tests/migrations/test_base.py +++ b/tests/migrations/test_base.py @@ -24,7 +24,7 @@ class MigrationTestBase(TransactionTestCase): def tearDown(self): # Reset applied-migrations state. - for db in connections: + for db in self.databases: recorder = MigrationRecorder(connections[db]) recorder.migration_qs.filter(app='migrations').delete() -- cgit v1.3