Improve debugging of unit tests when SQL statements don't match.

Review Request #8105 — Created April 7, 2016 and submitted

Information

Django Evolution
master
4ed032b...

Reviewers

The Django Evolution unit tests compare generated SQL statements with a
list of expected statements. When these don't match, there's very little
to go on for debugging.

This extends the debugging abilities by normalizing the generated and
expected SQL statements into a list of lines, showing both, and then
comparing the lists to help show where the differences are. This makes
it much easier to spot where things went wrong when there's a test
failure.

Unit tests pass.

Used this to debug test failures in the Django 1.7+ work.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        django_evolution/tests/base_test_case.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        django_evolution/tests/base_test_case.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (81d25cb)