# Path: tests/testapp/models.py
# class EnumModel(Model):
# class NullableEnumModel(Model):
# class CharSetModel(Model):
# class CharListModel(Model):
# class IntSetModel(Model):
# class IntListModel(Model):
# class CharSetDefaultModel(Model):
# class CharListDefaultModel(Model):
# class BigCharSetModel(Model):
# class BigCharListModel(Model):
# class BigIntSetModel(Model):
# class BigIntListModel(Model):
# class DynamicModel(Model):
# class SpeclessDynamicModel(Model):
# class FixedCharModel(Model):
# class Author(Model):
# class Book(Model):
# class VanillaAuthor(VanillaModel):
# class AuthorExtra(Model):
# class NameAuthor(Model):
# class NameAuthorExtra(Model):
# class AuthorMultiIndex(Model):
#     class Meta:
# class AuthorHugeName(Model):
#     class Meta:
# class Alphabet(Model):
# class ProxyAlphabet(Alphabet):
#     class Meta:
# class Customer(Model):
# class AgedCustomer(Customer):
# class TitledAgedCustomer(AgedCustomer):
#     class Meta:
# class SizeFieldModel(Model):
# class Bit1Model(Model):
#     class NullBit1Model(Model):
# class JSONModel(Model):
# class ExpensiveCalculation:
# class Poll(VanillaModel):
#     def check(cls, **kwargs):
#     def __str__(self):  # pragma: no cover
#     def check(cls, **kwargs):
#     def __str__(self):  # pragma: no cover
#     def a_times_b(self):
#     def __str__(self):  # pragma: no cover
#     def __init__(self) -> None:
#     def __call__(self) -> dt.datetime:
#     def reset(self) -> None:
#     def call_count(self) -> int:


import os
import pickle
import time
import types
import pytest
from decimal import Decimal
from io import StringIO
from typing import Any
from django.core.cache import CacheKeyWarning, cache, caches
from django.core.management import CommandError, call_command
from django.db import IntegrityError, connection
from django.db.migrations.state import ProjectState
from django.http import HttpResponse
from django.middleware.cache import FetchFromCacheMiddleware, UpdateCacheMiddleware
from django.test import RequestFactory, TestCase, TransactionTestCase
from django.test.utils import override_settings
from parameterized import parameterized
from django_mysql.cache import BIGINT_SIGNED_MAX, BIGINT_SIGNED_MIN, MySQLCache
from tests.testapp.models import Poll, expensive_calculation
        from zlib import compress, decompress
        from django.core.cache.backends.db import Options
        from django_mysql.cache import Options as OurOptions
class MySQLCacheTableMixin(TransactionTestCase):

    table_name = "test cache table"

    @classmethod
    def create_table(self):
        sql = MySQLCache.create_table_sql.format(table_name=self.table_name)
        with connection.cursor() as cursor:
            cursor.execute(sql)

    @classmethod
    def drop_table(self):
        with connection.cursor() as cursor:
            cursor.execute("DROP TABLE `%s`" % self.table_name)


@override_cache_settings()
class MySQLCacheTests(MySQLCacheTableMixin, TestCase):
    factory = RequestFactory()

    @classmethod
    def setUpClass(cls):
        cls.create_table()
        super().setUpClass()

    @classmethod
    def tearDownClass(cls):
        super().tearDownClass()
        cls.drop_table()


# Path: tests/testapp/models.py
# class EnumModel(Model):
# class NullableEnumModel(Model):
# class CharSetModel(Model):
# class CharListModel(Model):
# class IntSetModel(Model):
# class IntListModel(Model):
# class CharSetDefaultModel(Model):
# class CharListDefaultModel(Model):
# class BigCharSetModel(Model):
# class BigCharListModel(Model):
# class BigIntSetModel(Model):
# class BigIntListModel(Model):
# class DynamicModel(Model):
# class SpeclessDynamicModel(Model):
# class FixedCharModel(Model):
# class Author(Model):
# class Book(Model):
# class VanillaAuthor(VanillaModel):
# class AuthorExtra(Model):
# class NameAuthor(Model):
# class NameAuthorExtra(Model):
# class AuthorMultiIndex(Model):
#     class Meta:
# class AuthorHugeName(Model):
#     class Meta:
# class Alphabet(Model):
# class ProxyAlphabet(Alphabet):
#     class Meta:
# class Customer(Model):
# class AgedCustomer(Customer):
# class TitledAgedCustomer(AgedCustomer):
#     class Meta:
# class SizeFieldModel(Model):
# class Bit1Model(Model):
#     class NullBit1Model(Model):
# class JSONModel(Model):
# class ExpensiveCalculation:
# class Poll(VanillaModel):
#     def check(cls, **kwargs):
#     def __str__(self):  # pragma: no cover
#     def check(cls, **kwargs):
#     def __str__(self):  # pragma: no cover
#     def a_times_b(self):
#     def __str__(self):  # pragma: no cover
#     def __init__(self) -> None:
#     def __call__(self) -> dt.datetime:
#     def reset(self) -> None:
#     def call_count(self) -> int:


# Path: tests/testapp/test_cache.py
import os
import pickle
import time
import types
import pytest
from decimal import Decimal
from io import StringIO
from typing import Any
from django.core.cache import CacheKeyWarning, cache, caches
from django.core.management import CommandError, call_command
from django.db import IntegrityError, connection
from django.db.migrations.state import ProjectState
from django.http import HttpResponse
from django.middleware.cache import FetchFromCacheMiddleware, UpdateCacheMiddleware
from django.test import RequestFactory, TestCase, TransactionTestCase
from django.test.utils import override_settings
from parameterized import parameterized
from django_mysql.cache import BIGINT_SIGNED_MAX, BIGINT_SIGNED_MIN, MySQLCache
from tests.testapp.models import Poll, expensive_calculation
        from zlib import compress, decompress
        from django.core.cache.backends.db import Options
        from django_mysql.cache import Options as OurOptions

class MySQLCacheTableMixin(TransactionTestCase):

    table_name = "test cache table"

    @classmethod
    def create_table(self):
        sql = MySQLCache.create_table_sql.format(table_name=self.table_name)
        with connection.cursor() as cursor:
            cursor.execute(sql)

    @classmethod
    def drop_table(self):
        with connection.cursor() as cursor:
            cursor.execute("DROP TABLE `%s`" % self.table_name)


@override_cache_settings()
class MySQLCacheTests(MySQLCacheTableMixin, TestCase):
    factory = RequestFactory()

    @classmethod
    def setUpClass(cls):
        cls.create_table()
        super().setUpClass()

    @classmethod
    def tearDownClass(cls):
        super().tearDownClass()
        cls.drop_table()


    def table_count(self):