# Path: tests/testapp/utils.py
# def skip_if_mysql_8_plus():
# def column_type(table_name, column_name):
#     def __init__(self, conn=None):
#     def __enter__(self):
#     def __exit__(self, a, b, c):
#     def query(self):
#     def __init__(self, conn=None):
#     def __enter__(self):
#     def __exit__(self, a, b, c):
# def used_indexes(query, using=DEFAULT_DB_ALIAS):
# def fetchall_dicts(cursor):
# class CaptureLastQuery:
# class print_all_queries:


from django.core.management import call_command
from django.test import TestCase, TransactionTestCase
from django_mysql.checks import check_variables
from django_mysql.test.utils import override_mysql_variables
from tests.testapp.utils import skip_if_django_3_1_plus, skip_if_django_before_3_1
        assert errors == []

    @skip_if_django_before_3_1
    @override_mysql_variables(sql_mode="")
    def test_passes_databases_other(self):
        errors = check_variables(app_configs=None, databases=["other"])
        assert errors == []

    @skip_if_django_3_1_plus
    @override_mysql_variables(innodb_strict_mode=0)
    def test_fails_if_no_innodb_strict_old_django(self):
        errors = check_variables(app_configs=None)
        assert len(errors) == 1
        assert errors[0].id == "django_mysql.W002"
        assert "InnoDB Strict Mode" in errors[0].msg

    @skip_if_django_before_3_1
    @override_mysql_variables(innodb_strict_mode=0)
    def test_fails_if_no_innodb_strict(self):
        errors = check_variables(app_configs=None, databases=["default", "other"])
        assert len(errors) == 1
        assert errors[0].id == "django_mysql.W002"
        assert "InnoDB Strict Mode" in errors[0].msg

    @skip_if_django_3_1_plus
    @override_mysql_variables(character_set_connection="utf8")
    def test_fails_if_not_utf8mb4_old_django(self):
        errors = check_variables(app_configs=None)
        assert len(errors) == 1
        assert errors[0].id == "django_mysql.W003"

# Path: tests/testapp/utils.py
# def skip_if_mysql_8_plus():
# def column_type(table_name, column_name):
#     def __init__(self, conn=None):
#     def __enter__(self):
#     def __exit__(self, a, b, c):
#     def query(self):
#     def __init__(self, conn=None):
#     def __enter__(self):
#     def __exit__(self, a, b, c):
# def used_indexes(query, using=DEFAULT_DB_ALIAS):
# def fetchall_dicts(cursor):
# class CaptureLastQuery:
# class print_all_queries:


# Path: tests/testapp/test_checks.py
from django.core.management import call_command
from django.test import TestCase, TransactionTestCase
from django_mysql.checks import check_variables
from django_mysql.test.utils import override_mysql_variables
from tests.testapp.utils import skip_if_django_3_1_plus, skip_if_django_before_3_1

        assert errors == []

    @skip_if_django_before_3_1
    @override_mysql_variables(sql_mode="")
    def test_passes_databases_other(self):
        errors = check_variables(app_configs=None, databases=["other"])
        assert errors == []

    @skip_if_django_3_1_plus
    @override_mysql_variables(innodb_strict_mode=0)
    def test_fails_if_no_innodb_strict_old_django(self):
        errors = check_variables(app_configs=None)
        assert len(errors) == 1
        assert errors[0].id == "django_mysql.W002"
        assert "InnoDB Strict Mode" in errors[0].msg

    @skip_if_django_before_3_1
    @override_mysql_variables(innodb_strict_mode=0)
    def test_fails_if_no_innodb_strict(self):
        errors = check_variables(app_configs=None, databases=["default", "other"])
        assert len(errors) == 1
        assert errors[0].id == "django_mysql.W002"
        assert "InnoDB Strict Mode" in errors[0].msg

    @skip_if_django_3_1_plus
    @override_mysql_variables(character_set_connection="utf8")
    def test_fails_if_not_utf8mb4_old_django(self):
        errors = check_variables(app_configs=None)
        assert len(errors) == 1
        assert errors[0].id == "django_mysql.W003"

        assert "utf8mb4" in errors[0].msg