mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
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.
This commit is contained in:
committed by
Mariusz Felisiak
parent
26be703fe6
commit
2a2ea4ee18
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user