summaryrefslogtreecommitdiff
path: root/tests/cache
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-02-02 10:37:27 -0800
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-02-02 10:37:27 -0800
commit54bfa4caab11d364eb208ba6639836fa22d69a04 (patch)
treef24020307dd5b529989329bfabfc95effcecffe8 /tests/cache
parentab2f21080d8b3112c1ba9a0bf923eae733be4242 (diff)
parent3ffeb931869cc68a8e0916219702ee282afc6e9d (diff)
Merge pull request #2154 from manfre/close-cursors
Fixed #21751 -- Explicitly closed cursors.
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/tests.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index 94790ed740..bc0f705375 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -896,10 +896,9 @@ class DBCacheTests(BaseCacheTests, TransactionTestCase):
management.call_command('createcachetable', verbosity=0, interactive=False)
def drop_table(self):
- cursor = connection.cursor()
- table_name = connection.ops.quote_name('test cache table')
- cursor.execute('DROP TABLE %s' % table_name)
- cursor.close()
+ with connection.cursor() as cursor:
+ table_name = connection.ops.quote_name('test cache table')
+ cursor.execute('DROP TABLE %s' % table_name)
def test_zero_cull(self):
self._perform_cull_test(caches['zero_cull'], 50, 18)