Updated test suite for Django 1.7.
Flake8 fixes.