Fix spurious UI test failures from invalid ContentType cache

I found this solution at https://code.djangoproject.com/ticket/10827