Fixed test failures on Django 1.8