Update and document the database test data for indexes.

Review Request #8104 — Created April 6, 2016 and submitted

Information

Django Evolution
master
0ae495c...

Reviewers

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 of generate_index_name() using
the new make_generate_index_name() function, passing in the database
type. This allows generate_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

reviewbotreviewbot

Col: 47 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

Col: 45 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

Col: 47 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

Col: 45 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

Col: 47 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

Col: 45 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

Col: 47 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

Col: 45 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

Col: 47 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot
reviewbot
  1. 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
    
    
  2. django_evolution/tests/db/postgresql.py (Diff revision 1)
     
     
    Show all issues
    Col: 45
     E251 unexpected spaces around keyword / parameter equals
    
  3. django_evolution/tests/db/postgresql.py (Diff revision 1)
     
     
    Show all issues
    Col: 47
     E251 unexpected spaces around keyword / parameter equals
    
  4. django_evolution/tests/db/postgresql.py (Diff revision 1)
     
     
    Show all issues
    Col: 45
     E251 unexpected spaces around keyword / parameter equals
    
  5. django_evolution/tests/db/postgresql.py (Diff revision 1)
     
     
    Show all issues
    Col: 47
     E251 unexpected spaces around keyword / parameter equals
    
  6. django_evolution/tests/db/postgresql.py (Diff revision 1)
     
     
    Show all issues
    Col: 45
     E251 unexpected spaces around keyword / parameter equals
    
  7. django_evolution/tests/db/postgresql.py (Diff revision 1)
     
     
    Show all issues
    Col: 47
     E251 unexpected spaces around keyword / parameter equals
    
  8. django_evolution/tests/db/postgresql.py (Diff revision 1)
     
     
    Show all issues
    Col: 45
     E251 unexpected spaces around keyword / parameter equals
    
  9. django_evolution/tests/db/postgresql.py (Diff revision 1)
     
     
    Show all issues
    Col: 47
     E251 unexpected spaces around keyword / parameter equals
    
  10. django_evolution/tests/db/postgresql.py (Diff revision 1)
     
     
    Show all issues
    Col: 45
     E251 unexpected spaces around keyword / parameter equals
    
  11. django_evolution/tests/db/postgresql.py (Diff revision 1)
     
     
    Show all issues
    Col: 47
     E251 unexpected spaces around keyword / parameter equals
    
  12. 
      
chipx86
reviewbot
  1. 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
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (40ea24c)