mirror of
https://github.com/Hopiu/django-cachalot.git
synced 2026-05-20 10:21:51 +00:00
Fixes tests for Django 1.7 & MySQL.
This commit is contained in:
parent
e276d3961c
commit
5a4f0a4f7a
1 changed files with 10 additions and 0 deletions
|
|
@ -554,6 +554,11 @@ class DatabaseCommandTestCase(TransactionTestCase):
|
|||
|
||||
call_command('flush', verbosity=0, interactive=False)
|
||||
|
||||
if django_version >= (1, 7) and connection.vendor == 'mysql':
|
||||
# We need to reopen the connection or Django
|
||||
# will execute an extra SQL request below.
|
||||
connection.cursor()
|
||||
|
||||
with self.assertNumQueries(1):
|
||||
self.assertListEqual(list(Test.objects.all()), [])
|
||||
|
||||
|
|
@ -564,6 +569,11 @@ class DatabaseCommandTestCase(TransactionTestCase):
|
|||
call_command('loaddata', 'cachalot/tests/loaddata_fixture.json',
|
||||
verbosity=0, interactive=False)
|
||||
|
||||
if django_version >= (1, 7) and connection.vendor == 'mysql':
|
||||
# We need to reopen the connection or Django
|
||||
# will execute an extra SQL request below.
|
||||
connection.cursor()
|
||||
|
||||
with self.assertNumQueries(1):
|
||||
self.assertListEqual([t.name for t in Test.objects.all()],
|
||||
['test1', 'test2'])
|
||||
|
|
|
|||
Loading…
Reference in a new issue