1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #24675 -- Skipped SQL_AUTO_IS_NULL query on MySQL if not needed.

This commit is contained in:
Stewart Park
2015-12-14 18:19:40 -08:00
committed by Tim Graham
parent 3d2236773b
commit b7fdd60d85
3 changed files with 33 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
from __future__ import unicode_literals
import unittest
from django.db import connection
from django.test import TestCase, override_settings
@override_settings(DEBUG=True)
@unittest.skipUnless(connection.vendor == 'mysql', 'MySQL specific test.')
class MySQLTests(TestCase):
def test_auto_is_null_auto_config(self):
query = 'set sql_auto_is_null = 0'
connection.init_connection_state()
last_query = connection.queries[-1]['sql'].lower()
if connection.features.is_sql_auto_is_null_enabled:
self.assertIn(query, last_query)
else:
self.assertNotIn(query, last_query)