mirror of
https://github.com/Hopiu/django-cachalot.git
synced 2026-05-12 22:53:11 +00:00
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.
This commit is contained in:
parent
984b3f2530
commit
5e5ba9321d
1 changed files with 0 additions and 21 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Reference in a new issue