Ticket #11675: test.diff
File test.diff, 1.4 KB (added by , 15 years ago) |
---|
-
tests/regressiontests/cache/tests.py
3 3 # Unit tests for cache framework 4 4 # Uses whatever cache backend is set in the test settings file. 5 5 6 import sys 6 7 import os 7 8 import shutil 8 9 import tempfile … … 11 12 12 13 from django.conf import settings 13 14 from django.core import management 14 from django.core.cache import get_cache 15 from django.core.cache import get_cache, parse_backend_uri 15 16 from django.core.cache.backends.base import InvalidCacheBackendError 16 17 from django.http import HttpResponse, HttpRequest 17 18 from django.utils.cache import patch_vary_headers, get_cache_key, learn_cache_key … … 347 348 def setUp(self): 348 349 self.cache = get_cache(settings.CACHE_BACKEND) 349 350 351 def test_memcache_module_import(self): 352 """ 353 Test that the proper module (i.e. cmemcache or memcache) is 354 being imported. 355 """ 356 scheme, host, params = parse_backend_uri(settings.CACHE_BACKEND) 357 if 'lib' in params: 358 lib = params['lib'] 359 self.assertTrue(sys.modules.has_key(lib)) 360 361 350 362 class FileBasedCacheTests(unittest.TestCase, BaseCacheTests): 351 363 """ 352 364 Specific test cases for the file-based cache.