diff options
Diffstat (limited to 'tests/regressiontests/cache')
| -rw-r--r-- | tests/regressiontests/cache/tests.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py index 2832bcbdd9..2f46c0b1aa 100644 --- a/tests/regressiontests/cache/tests.py +++ b/tests/regressiontests/cache/tests.py @@ -3,6 +3,7 @@ # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. +import hashlib import os import tempfile import time @@ -19,7 +20,6 @@ from django.test.utils import get_warnings_state, restore_warnings_state from django.utils import translation from django.utils import unittest from django.utils.cache import patch_vary_headers, get_cache_key, learn_cache_key -from django.utils.hashcompat import md5_constructor from django.views.decorators.cache import cache_page from regressiontests.cache.models import Poll, expensive_calculation @@ -850,7 +850,7 @@ class FileBasedCacheTests(unittest.TestCase, BaseCacheTests): """Test that keys are hashed into subdirectories correctly""" self.cache.set("foo", "bar") key = self.cache.make_key("foo") - keyhash = md5_constructor(key).hexdigest() + keyhash = hashlib.md5(key).hexdigest() keypath = os.path.join(self.dirname, keyhash[:2], keyhash[2:4], keyhash[4:]) self.assertTrue(os.path.exists(keypath)) @@ -860,7 +860,7 @@ class FileBasedCacheTests(unittest.TestCase, BaseCacheTests): """ self.cache.set("foo", "bar") key = self.cache.make_key("foo") - keyhash = md5_constructor(key).hexdigest() + keyhash = hashlib.md5(key).hexdigest() keypath = os.path.join(self.dirname, keyhash[:2], keyhash[2:4], keyhash[4:]) self.assertTrue(os.path.exists(keypath)) |
