1
0
mirror of https://github.com/django/django.git synced 2025-04-11 19:12:22 +00:00
django/tests/test_runner
Harm Geerts b89ce413f2 [3.2.x] Fixed #29052 -- Made test database creation preserve alias order and prefer the "default" database.
This fixes flushing test databases when two aliases point to the same
database.

Use a list() to store the test database aliases so the order remains
stable by following the order of the connections. Also, always use the
"default" database alias as the first alias to accommodate `migrate`.

Previously `migrate` could be executed on a secondary alias which
caused truncating the "default" database.

Backport of 06e5f7ae1639f1e275e7cc1076dc70ca3ebaa946 from master
2021-02-16 13:08:13 +01:00
..