diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-02-11 13:11:47 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-02-11 13:11:47 +0000 |
| commit | d4a34b5508a73c47d9e7220ee92dd7b8fb9e4262 (patch) | |
| tree | 2ea949896c6ca1aa02ef0d4d46e35298d5ee77c2 /tests | |
| parent | a9282168f5952cfb5c7008c603aed78aaff142b2 (diff) | |
[1.1.X] Fixed #11623 -- Corrected table name quoting in db cache backend. Thanks to Fraser Nevett for the report and fix.
Backport of r12410 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12414 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/cache/tests.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py index 64f6130860..9a84667085 100644 --- a/tests/regressiontests/cache/tests.py +++ b/tests/regressiontests/cache/tests.py @@ -296,13 +296,15 @@ class BaseCacheTests(object): class DBCacheTests(unittest.TestCase, BaseCacheTests): def setUp(self): - management.call_command('createcachetable', 'test_cache_table', verbosity=0, interactive=False) - self.cache = get_cache('db://test_cache_table') + # Spaces are used in the table name to ensure quoting/escaping is working + self._table_name = 'test cache table' + management.call_command('createcachetable', self._table_name, verbosity=0, interactive=False) + self.cache = get_cache('db://%s' % self._table_name) def tearDown(self): from django.db import connection cursor = connection.cursor() - cursor.execute('DROP TABLE test_cache_table'); + cursor.execute('DROP TABLE %s' % connection.ops.quote_name(self._table_name)) class LocMemCacheTests(unittest.TestCase, BaseCacheTests): def setUp(self): |
