1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +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:
Matthijs Kooijman
2019-12-20 20:49:56 +01:00
committed by Mariusz Felisiak
parent 26be703fe6
commit 2a2ea4ee18
9 changed files with 46 additions and 34 deletions

View File

@@ -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()