summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-01-13 16:24:19 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-01-13 16:24:19 +0000
commit3ce473617cdb6fa12b7456fa07cdafef63e40e52 (patch)
treee13248ca19b129b8525fc454c1d1ae4eb8899eae
parent3297c09da4426b6dd2b7122d67a103536b26bce9 (diff)
[1.2.X] Fixed #14975, #14925 -- Added some cache flushing to avoid some cross-test effects. Thanks to jsdalton and rpbarlow for the reports.
Backport of r15192 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15193 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/auth/tests/auth_backends.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/django/contrib/auth/tests/auth_backends.py b/django/contrib/auth/tests/auth_backends.py
index 536833e2be..7980cdb075 100644
--- a/django/contrib/auth/tests/auth_backends.py
+++ b/django/contrib/auth/tests/auth_backends.py
@@ -17,6 +17,10 @@ class BackendTest(TestCase):
def tearDown(self):
settings.AUTHENTICATION_BACKENDS = self.curr_auth
+ # The custom_perms test messes with ContentTypes, which will
+ # be cached; flush the cache to ensure there are no side effects
+ # Refs #14975, #14925
+ ContentType.objects.clear_cache()
def test_has_perm(self):
user = User.objects.get(username='test')
@@ -161,6 +165,10 @@ class RowlevelBackendTest(TestCase):
def tearDown(self):
settings.AUTHENTICATION_BACKENDS = self.curr_auth
+ # The get_group_permissions test messes with ContentTypes, which will
+ # be cached; flush the cache to ensure there are no side effects
+ # Refs #14975, #14925
+ ContentType.objects.clear_cache()
def test_has_perm(self):
self.assertEqual(self.user1.has_perm('perm', TestObj()), False)