Fix tests for Django 1.4/Python 2.6