Fix tests under Django 1.6.

Fix #425.