Work around Django issue 10827
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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)
|
More like this
- Browser-native date input field by kytta 1 month, 1 week ago
- Generate and render HTML Table by LLyaudet 1 month, 2 weeks ago
- My firs Snippets by GutemaG 1 month, 3 weeks ago
- FileField having auto upload_to path by junaidmgithub 2 months, 4 weeks ago
- LazyPrimaryKeyRelatedField by LLyaudet 3 months ago
Comments
Please login first before commenting.