# Path: tests/testapp/models.py
# class Bit1Model(Model):
#     flag_a: Any = Bit1BooleanField(default=True)
#     flag_b: Any = Bit1BooleanField(default=False)


import json
import django
from django.core import checks, serializers
from django.db import models
from django.db.models import F
from django.test import SimpleTestCase, TestCase
from django.test.utils import isolate_apps
from django_mysql.models import NullBit1BooleanField
from tests.testapp.models import Bit1Model
    from tests.testapp.models import NullBit1Model

        m.save()

        m = Bit1Model.objects.get(id=m.id)
        assert not m.flag_a
        assert m.flag_b

        m.flag_a = True
        m.flag_b = False
        m.save()

        m = Bit1Model.objects.get(id=m.id)
        assert m.flag_a
        assert not m.flag_b

    def test_defaults(self):
        m = Bit1Model.objects.create()
        assert m.flag_a
        assert not m.flag_b

        m = Bit1Model.objects.get(id=m.id)
        assert m.flag_a
        assert not m.flag_b

    def test_filter(self):
        m = Bit1Model.objects.create(flag_a=True, flag_b=True)

        assert list(Bit1Model.objects.filter(flag_a=True)) == [m]
        assert list(Bit1Model.objects.filter(flag_a=False)) == []


# Path: tests/testapp/models.py
# class Bit1Model(Model):
#     flag_a: Any = Bit1BooleanField(default=True)
#     flag_b: Any = Bit1BooleanField(default=False)


# Path: tests/testapp/test_bit1_field.py
import json
import django
from django.core import checks, serializers
from django.db import models
from django.db.models import F
from django.test import SimpleTestCase, TestCase
from django.test.utils import isolate_apps
from django_mysql.models import NullBit1BooleanField
from tests.testapp.models import Bit1Model
    from tests.testapp.models import NullBit1Model


        m.save()

        m = Bit1Model.objects.get(id=m.id)
        assert not m.flag_a
        assert m.flag_b

        m.flag_a = True
        m.flag_b = False
        m.save()

        m = Bit1Model.objects.get(id=m.id)
        assert m.flag_a
        assert not m.flag_b

    def test_defaults(self):
        m = Bit1Model.objects.create()
        assert m.flag_a
        assert not m.flag_b

        m = Bit1Model.objects.get(id=m.id)
        assert m.flag_a
        assert not m.flag_b

    def test_filter(self):
        m = Bit1Model.objects.create(flag_a=True, flag_b=True)

        assert list(Bit1Model.objects.filter(flag_a=True)) == [m]
        assert list(Bit1Model.objects.filter(flag_a=False)) == []


        assert list(Bit1Model.objects.filter(flag_a=F("flag_b"))) == [m]