Work around 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

  1. Django cycle tag that doesn't continue where it left off by wilfred 4 months ago
  2. Hidden Date Display Widget for Admin by andrew.schoen 3 years, 9 months ago
  3. urlquote() and urlencode() in one method by guettli 4 years, 6 months ago
  4. Automatic stripping textual form fields by nail.xx 4 years, 9 months ago
  5. unique validation for ModelForm by whiskybar 5 years, 2 months ago

Comments

(Forgotten your password?)