Fix tests for Django 1.3 and Py 2.6