summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-02-11 12:21:46 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-02-11 12:21:46 +0000
commitab828da2b91c71987ef23baee4a1613fdb330c5f (patch)
tree2561aef8aeac5a1273dac528cdf94c3ec8ccda02 /tests/regressiontests
parent4d2f489bca6b1807724f4b619d70ae8d6d1bda08 (diff)
Fixed #11623 -- Corrected table name quoting in db cache backend. Thanks to Fraser Nevett for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12410 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/cache/tests.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py
index 6ca4d8bce8..5d8d039cf5 100644
--- a/tests/regressiontests/cache/tests.py
+++ b/tests/regressiontests/cache/tests.py
@@ -342,13 +342,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):