1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Made the database cache backend, which bypasses the ORM, compatible with time zone support.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17119 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Aymeric Augustin
2011-11-20 10:17:12 +00:00
parent f6ee168919
commit 7075e93256
3 changed files with 59 additions and 18 deletions

View File

@@ -746,7 +746,7 @@ def custom_key_func(key, key_prefix, version):
return 'CUSTOM-' + '-'.join([key_prefix, str(version), key])
class DBCacheTests(unittest.TestCase, BaseCacheTests):
class DBCacheTests(BaseCacheTests, TestCase):
backend_name = 'django.core.cache.backends.db.DatabaseCache'
def setUp(self):
@@ -763,6 +763,7 @@ class DBCacheTests(unittest.TestCase, BaseCacheTests):
from django.db import connection
cursor = connection.cursor()
cursor.execute('DROP TABLE %s' % connection.ops.quote_name(self._table_name))
connection.commit()
def test_cull(self):
self.perform_cull_test(50, 29)
@@ -776,6 +777,9 @@ class DBCacheTests(unittest.TestCase, BaseCacheTests):
self.perform_cull_test(50, 18)
DBCacheWithTimeZoneTests = override_settings(USE_TZ=True)(DBCacheTests)
class DBCacheRouter(object):
"""A router that puts the cache table on the 'other' database."""