File: test_mysql.py

package info (click to toggle)
python-django 1%3A1.10.7-2%2Bdeb9u9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 46,768 kB
  • sloc: python: 210,877; javascript: 18,032; xml: 201; makefile: 198; sh: 145
file content (20 lines) | stat: -rw-r--r-- 637 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)