# Path: tests/testapp/models.py
# class CharListDefaultModel(Model):
#     field = ListCharField(
#         base_field=CharField(max_length=5),
#         size=5,
#         max_length=32,
#         default=lambda: ["a", "d"],
#     )
# 
# class CharListModel(Model):
#     field = ListCharField(base_field=CharField(max_length=8), size=3, max_length=32)
# 
# class IntListModel(Model):
#     field = ListCharField(base_field=IntegerField(), size=5, max_length=32)


import json
import re
import pytest
from django import forms
from django.core import exceptions, serializers
from django.core.management import call_command
from django.db import connection, models
from django.db.migrations.writer import MigrationWriter
from django.db.models import Q, Value
from django.test import SimpleTestCase, TestCase, TransactionTestCase, override_settings
from django.test.utils import isolate_apps
from django_mysql.forms import SimpleListField
from django_mysql.models import ListCharField, ListF
from django_mysql.test.utils import override_mysql_variables
from tests.testapp.models import CharListDefaultModel, CharListModel, IntListModel
        assert empty.count() == 1
        assert empty[0] == mymodel

        one = CharListModel.objects.filter(field__len=1)
        assert one.count() == 0

        one_or_more = CharListModel.objects.filter(field__len__gte=0)
        assert one_or_more.count() == 1

    def test_char_len_lookup(self):
        mymodel = CharListModel.objects.create(field=["red", "expensive"])

        empty = CharListModel.objects.filter(field__len=0)
        assert empty.count() == 0

        one_or_more = CharListModel.objects.filter(field__len__gte=1)
        assert one_or_more.count() == 1
        assert one_or_more[0] == mymodel

        two = CharListModel.objects.filter(field__len=2)
        assert two.count() == 1
        assert two[0] == mymodel

        three = CharListModel.objects.filter(field__len=3)
        assert three.count() == 0

    def test_char_default(self):
        mymodel = CharListDefaultModel.objects.create()
        assert mymodel.field == ["a", "d"]


# Path: tests/testapp/models.py
# class CharListDefaultModel(Model):
#     field = ListCharField(
#         base_field=CharField(max_length=5),
#         size=5,
#         max_length=32,
#         default=lambda: ["a", "d"],
#     )
# 
# class CharListModel(Model):
#     field = ListCharField(base_field=CharField(max_length=8), size=3, max_length=32)
# 
# class IntListModel(Model):
#     field = ListCharField(base_field=IntegerField(), size=5, max_length=32)


# Path: tests/testapp/test_listcharfield.py
import json
import re
import pytest
from django import forms
from django.core import exceptions, serializers
from django.core.management import call_command
from django.db import connection, models
from django.db.migrations.writer import MigrationWriter
from django.db.models import Q, Value
from django.test import SimpleTestCase, TestCase, TransactionTestCase, override_settings
from django.test.utils import isolate_apps
from django_mysql.forms import SimpleListField
from django_mysql.models import ListCharField, ListF
from django_mysql.test.utils import override_mysql_variables
from tests.testapp.models import CharListDefaultModel, CharListModel, IntListModel

        assert empty.count() == 1
        assert empty[0] == mymodel

        one = CharListModel.objects.filter(field__len=1)
        assert one.count() == 0

        one_or_more = CharListModel.objects.filter(field__len__gte=0)
        assert one_or_more.count() == 1

    def test_char_len_lookup(self):
        mymodel = CharListModel.objects.create(field=["red", "expensive"])

        empty = CharListModel.objects.filter(field__len=0)
        assert empty.count() == 0

        one_or_more = CharListModel.objects.filter(field__len__gte=1)
        assert one_or_more.count() == 1
        assert one_or_more[0] == mymodel

        two = CharListModel.objects.filter(field__len=2)
        assert two.count() == 1
        assert two[0] == mymodel

        three = CharListModel.objects.filter(field__len=3)
        assert three.count() == 0

    def test_char_default(self):
        mymodel = CharListDefaultModel.objects.create()
        assert mymodel.field == ["a", "d"]


        mymodel = CharListDefaultModel.objects.get(id=mymodel.id)