# Path: tests/testapp/models.py
# class EnumModel(Model):
#     field = EnumField(
#         choices=[
#             ("red", "Red"),
#             ("bloodred", "Blood Red"),
#             "green",
#             ("blue", "Navy Blue"),
#             ("coralblue", "Coral Blue"),
#         ]
#     )
# 
# class NullableEnumModel(Model):
#     field = EnumField(
#         choices=["goat", ("deer", "Deer"), "bull", "dog's"],  # Test if escaping works
#         null=True,
#     )


import pytest
from django.core.exceptions import ValidationError
from django.core.management import call_command
from django.db import connection
from django.db.utils import DataError
from django.test import TestCase, TransactionTestCase, override_settings
from django_mysql.models import EnumField
from tests.testapp.models import EnumModel, NullableEnumModel
        actual = EnumModel.objects.filter(field="green")
        expected = [s1, s2]

        assert list(actual) == expected

    def test_in_lookup(self):
        s1 = EnumModel.objects.create(field="green")
        EnumModel.objects.create(field="red")
        s2 = EnumModel.objects.create(field="green")

        actual = EnumModel.objects.filter(field__in=["green"])
        expected = [s1, s2]

        assert list(actual) == expected

    def test_icontains_lookup(self):
        s1 = EnumModel.objects.create(field="coralBlue")
        s2 = EnumModel.objects.create(field="blue")
        EnumModel.objects.create(field="green")

        actual = EnumModel.objects.filter(field__icontains="Blue")
        expected = [s1, s2]

        assert list(actual) == expected

    def test_contains_lookup(self):
        s1 = EnumModel.objects.create(field="coralblue")
        s2 = EnumModel.objects.create(field="blue")
        EnumModel.objects.create(field="green")


# Path: tests/testapp/models.py
# class EnumModel(Model):
#     field = EnumField(
#         choices=[
#             ("red", "Red"),
#             ("bloodred", "Blood Red"),
#             "green",
#             ("blue", "Navy Blue"),
#             ("coralblue", "Coral Blue"),
#         ]
#     )
# 
# class NullableEnumModel(Model):
#     field = EnumField(
#         choices=["goat", ("deer", "Deer"), "bull", "dog's"],  # Test if escaping works
#         null=True,
#     )


# Path: tests/testapp/test_enumfield.py
import pytest
from django.core.exceptions import ValidationError
from django.core.management import call_command
from django.db import connection
from django.db.utils import DataError
from django.test import TestCase, TransactionTestCase, override_settings
from django_mysql.models import EnumField
from tests.testapp.models import EnumModel, NullableEnumModel

        actual = EnumModel.objects.filter(field="green")
        expected = [s1, s2]

        assert list(actual) == expected

    def test_in_lookup(self):
        s1 = EnumModel.objects.create(field="green")
        EnumModel.objects.create(field="red")
        s2 = EnumModel.objects.create(field="green")

        actual = EnumModel.objects.filter(field__in=["green"])
        expected = [s1, s2]

        assert list(actual) == expected

    def test_icontains_lookup(self):
        s1 = EnumModel.objects.create(field="coralBlue")
        s2 = EnumModel.objects.create(field="blue")
        EnumModel.objects.create(field="green")

        actual = EnumModel.objects.filter(field__icontains="Blue")
        expected = [s1, s2]

        assert list(actual) == expected

    def test_contains_lookup(self):
        s1 = EnumModel.objects.create(field="coralblue")
        s2 = EnumModel.objects.create(field="blue")
        EnumModel.objects.create(field="green")


        actual = EnumModel.objects.filter(field__contains="blue")