# Path: tests/testapp/models.py
# class Author(Model):
#     name = CharField(max_length=32, db_index=True)
#     tutor = ForeignKey("self", on_delete=CASCADE, null=True, related_name="tutees")
#     bio = TextField()
#     birthday = DateTimeField(null=True)
#     deathday = DateTimeField(null=True)


from django.test import TestCase
from tests.testapp.models import Author
from __future__ import annotations




class CaseExactTests(TestCase):
    def test_charfield(self):
        dickie = Author.objects.create(name="Dickens")

        authors = Author.objects.filter(name__case_exact="dickens")
        assert list(authors) == []

        authors = Author.objects.filter(name__case_exact="Dickens")
        assert list(authors) == [dickie]

        authors = Author.objects.filter(name__case_exact="DICKENS")
        assert list(authors) == []

    def test_charfield_lowercase(self):
        dickie = Author.objects.create(name="dickens")

        authors = Author.objects.filter(name__case_exact="dickens")
        assert list(authors) == [dickie]


# Path: tests/testapp/models.py
# class Author(Model):
#     name = CharField(max_length=32, db_index=True)
#     tutor = ForeignKey("self", on_delete=CASCADE, null=True, related_name="tutees")
#     bio = TextField()
#     birthday = DateTimeField(null=True)
#     deathday = DateTimeField(null=True)


# Path: tests/testapp/test_lookups.py
from django.test import TestCase
from tests.testapp.models import Author

from __future__ import annotations




class CaseExactTests(TestCase):
    def test_charfield(self):
        dickie = Author.objects.create(name="Dickens")

        authors = Author.objects.filter(name__case_exact="dickens")
        assert list(authors) == []

        authors = Author.objects.filter(name__case_exact="Dickens")
        assert list(authors) == [dickie]

        authors = Author.objects.filter(name__case_exact="DICKENS")
        assert list(authors) == []

    def test_charfield_lowercase(self):
        dickie = Author.objects.create(name="dickens")

        authors = Author.objects.filter(name__case_exact="dickens")
        assert list(authors) == [dickie]


        authors = Author.objects.filter(name__case_exact="Dickens")