This commit is contained in:
haydeec1
2021-06-02 02:14:29 -04:00
parent 6aa9ec9d57
commit 62c70250a9
2 changed files with 11 additions and 2 deletions

View File

@ -68,6 +68,13 @@ async def test_is_null():
assert tolkien.books[0].year is None
assert tolkien.books[0].title == "The Hobbit"
tolkien = await Author.objects.select_related("books").paginate(1, 10).get(
books__year__isnull=True
)
assert len(tolkien.books) == 1
assert tolkien.books[0].year is None
assert tolkien.books[0].title == "The Hobbit"
tolkien = await Author.objects.select_related("books").get(
books__year__isnull=False
)