From 5e5ba9321dbff1b9145b3e7fbee69ae0fbb99386 Mon Sep 17 00:00:00 2001 From: Bertrand Bordage Date: Sun, 7 Dec 2014 03:40:27 +0100 Subject: [PATCH] Removes an invalid test. `cursor.executemany` should never accept SELECTs. In practice, MySQL accepts it but returns erroneous data. But SQLite and PostgreSQL are raising an exception, as expected. --- cachalot/tests/read.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/cachalot/tests/read.py b/cachalot/tests/read.py index ee4ac7c..3234068 100644 --- a/cachalot/tests/read.py +++ b/cachalot/tests/read.py @@ -2,10 +2,6 @@ from __future__ import unicode_literals import datetime -try: - from unittest import skipIf -except ImportError: # For Python 2.6 - from unittest2 import skipIf from django.contrib.auth.models import Group, Permission, User from django.core.cache import cache @@ -549,23 +545,6 @@ class ReadTestCase(TransactionTestCase): self.assertListEqual(data2, data1) self.assertListEqual(data2, list(Test.objects.values_list())) - def test_cursor_executemany(self): - sql = 'SELECT * FROM %s WHERE name = %%s;' % Test._meta.db_table - - param_list = [('test1',)] - with self.assertNumQueries(1): - cursor = connection.cursor() - cursor.executemany(sql, param_list) - data1 = list(cursor.fetchall()) - cursor.close() - with self.assertNumQueries(1): - cursor = connection.cursor() - cursor.executemany(sql, param_list) - data2 = list(cursor.fetchall()) - cursor.close() - self.assertListEqual(data2, data1) - self.assertListEqual(data2, list(Test.objects.filter(name='test1').values_list())) - def test_missing_table_cache_key(self): with self.assertNumQueries(1): list(Test.objects.all())