# 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 model.field == ["nice", "nice"]

    def test_append_with_expression(self):
        CharListModel.objects.create(field=["a"])
        CharListModel.objects.update(field=ListF("field").append(Value("b")))
        model = CharListModel.objects.get()
        assert model.field == ["a", "b"]

    @override_mysql_variables(SQL_MODE="ANSI")
    def test_append_works_in_ansi_mode(self):
        CharListModel.objects.create()
        CharListModel.objects.update(field=ListF("field").append("big"))
        CharListModel.objects.update(field=ListF("field").append("bad"))
        model = CharListModel.objects.get()
        assert model.field == ["big", "bad"]

    def test_append_assignment(self):
        model = CharListModel.objects.create(field=["red"])
        model.field = ListF("field").append("blue")
        model.save()
        model = CharListModel.objects.get()
        assert model.field == ["red", "blue"]

    def test_appendleft_to_none(self):
        CharListModel.objects.create(field=[])
        CharListModel.objects.update(field=ListF("field").appendleft("first"))
        model = CharListModel.objects.get()
        assert model.field == ["first"]

    def test_appendleft_to_one(self):

# 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 model.field == ["nice", "nice"]

    def test_append_with_expression(self):
        CharListModel.objects.create(field=["a"])
        CharListModel.objects.update(field=ListF("field").append(Value("b")))
        model = CharListModel.objects.get()
        assert model.field == ["a", "b"]

    @override_mysql_variables(SQL_MODE="ANSI")
    def test_append_works_in_ansi_mode(self):
        CharListModel.objects.create()
        CharListModel.objects.update(field=ListF("field").append("big"))
        CharListModel.objects.update(field=ListF("field").append("bad"))
        model = CharListModel.objects.get()
        assert model.field == ["big", "bad"]

    def test_append_assignment(self):
        model = CharListModel.objects.create(field=["red"])
        model.field = ListF("field").append("blue")
        model.save()
        model = CharListModel.objects.get()
        assert model.field == ["red", "blue"]

    def test_appendleft_to_none(self):
        CharListModel.objects.create(field=[])
        CharListModel.objects.update(field=ListF("field").appendleft("first"))
        model = CharListModel.objects.get()
        assert model.field == ["first"]

    def test_appendleft_to_one(self):

        CharListModel.objects.create(field=["big"])