Fix tests on Django 1.5-1.7