Provide connection information when generating index names for tests.

Review Request #9561 — Created Jan. 31, 2018 and submitted — Latest diff uploaded

Information

Django Evolution
master
65fdaf3...

Reviewers

The per-database unit test data modules now pass a connection for the
appropriate database type to the functions used to generate index names.
This will be required for Django 1.11, which will have logic that's more
connection-dependent.

To do this, we now have our own test_connections that works like
django.db.connections, but is based on the unit test databases. This
is needed because those databases are not registered in
settings.DATABASES (since that would otherwise require each database
to be set up and would register tables in each). Each of the database
data modules now make use of this instead of assuming that
django.db.connection matches the correct database type.

Unit tests pass on Django 1.6 through 1.10 with all database types.