from django.test import TransactionTestCase as DjangoTransactionTestCase [...] class TransactionTestCase(DjangoTransactionTestCase): """ Works around Django issue 10827 by clearing the ContentType cache before permissions are setup. """ def _pre_setup(self, *args, **kwargs): ContentType.objects.clear_cache() super(TransactionTestCase, self)._pre_setup(*args, **kwargs)