Skip to content

Commit

Permalink
Fixed #14975, #14925 -- Added some cache flushing to avoid some cross…
Browse files Browse the repository at this point in the history
…-test effects. Thanks to jsdalton and rpbarlow for the reports.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15192 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
freakboy3742 committed Jan 13, 2011
1 parent 2d35244 commit 8781ea6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions django/contrib/auth/tests/auth_backends.py
Expand Up @@ -19,6 +19,10 @@ def setUp(self):

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')
Expand Down Expand Up @@ -174,6 +178,10 @@ def setUp(self):
def tearDown(self):
settings.AUTHENTICATION_BACKENDS = self.curr_auth
self.restore_warnings_state()
# 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)
Expand Down

0 comments on commit 8781ea6

Please sign in to comment.