Update and document the database test data for indexes.
Review Request #8104 — Created April 6, 2016 and submitted
Our sets of comparison SQL statements used for the unit tests had some
statements left with hard-coded index names, which aren't future-proof.This change fixes those and prepares for the Django 1.7+ work by beefing
up how the test index name generation works. Each file of test SQL
statements now creates a local version ofgenerate_index_name()
using
the newmake_generate_index_name()
function, passing in the database
type. This allowsgenerate_index_name()
to be smarter about how it
handles certain types of indexes, particularly those for Postgres
(which, through Django 1.6, used a legacy set of rules for generating
index names).There's also additional information now indicating if an index will be
used for Django's index_together.Future changes will build upon this by creating variations of the index
name generation rules for Django 1.7, 1.8, and 1.9.There's also new documentation in place for the affected functions, to
help with future maintenance.
Unit tests pass for SQLite3, MySQL, and Postgres.
Description | From | Last Updated |
---|---|---|
Col: 45 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 47 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 45 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 47 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 45 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 47 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 45 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 47 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 45 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 47 E251 unexpected spaces around keyword / parameter equals |
reviewbot |
- Change Summary:
-
Removed spaces that snuck in and then got copy/pasted around a keyword argument's
=
. - Commit:
-
0578b3fdf84bac69e61b7da72d12457d0c915d680ae495c00f167aaa1547e68c2dcd536eed0a8126
-
Tool: Pyflakes Processed Files: django_evolution/tests/db/postgresql.py django_evolution/tests/db/mysql.py django_evolution/tests/db/sqlite3.py django_evolution/tests/utils.py Tool: PEP8 Style Checker Processed Files: django_evolution/tests/db/postgresql.py django_evolution/tests/db/mysql.py django_evolution/tests/db/sqlite3.py django_evolution/tests/utils.py