Fix testing code up slightly.

Note that running the full test suite will fail, as django's
contenttypes test suite has side effects.