Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.2.X] Fixed #14975, #14925 -- Added some cache flushing to avoid so…

…me 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
  • Loading branch information...
commit 3ce473617cdb6fa12b7456fa07cdafef63e40e52 1 parent 3297c09
Russell Keith-Magee authored January 13, 2011
8  django/contrib/auth/tests/auth_backends.py
@@ -17,6 +17,10 @@ def setUp(self):
17 17
 
18 18
     def tearDown(self):
19 19
         settings.AUTHENTICATION_BACKENDS = self.curr_auth
  20
+        # The custom_perms test messes with ContentTypes, which will
  21
+        # be cached; flush the cache to ensure there are no side effects
  22
+        # Refs #14975, #14925
  23
+        ContentType.objects.clear_cache()
20 24
 
21 25
     def test_has_perm(self):
22 26
         user = User.objects.get(username='test')
@@ -161,6 +165,10 @@ def setUp(self):
161 165
 
162 166
     def tearDown(self):
163 167
         settings.AUTHENTICATION_BACKENDS = self.curr_auth
  168
+        # The get_group_permissions test messes with ContentTypes, which will
  169
+        # be cached; flush the cache to ensure there are no side effects
  170
+        # Refs #14975, #14925
  171
+        ContentType.objects.clear_cache()
164 172
 
165 173
     def test_has_perm(self):
166 174
         self.assertEqual(self.user1.has_perm('perm', TestObj()), False)

0 notes on commit 3ce4736

Please sign in to comment.
Something went wrong with that request. Please try again.