mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #29227 -- Allowed BooleanField to be null=True.
Thanks Lynn Cyrin for contributing to the patch, and Nick Pope for review.
This commit is contained in:
@@ -521,13 +521,15 @@ class NonAggregateAnnotationTestCase(TestCase):
|
||||
books = Book.objects.annotate(
|
||||
is_book=Value(True, output_field=BooleanField()),
|
||||
is_pony=Value(False, output_field=BooleanField()),
|
||||
is_none=Value(None, output_field=NullBooleanField()),
|
||||
is_none=Value(None, output_field=BooleanField(null=True)),
|
||||
is_none_old=Value(None, output_field=NullBooleanField()),
|
||||
)
|
||||
self.assertGreater(len(books), 0)
|
||||
for book in books:
|
||||
self.assertIs(book.is_book, True)
|
||||
self.assertIs(book.is_pony, False)
|
||||
self.assertIsNone(book.is_none)
|
||||
self.assertIsNone(book.is_none_old)
|
||||
|
||||
def test_annotation_in_f_grouped_by_annotation(self):
|
||||
qs = (
|
||||
|
||||
Reference in New Issue
Block a user