mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #34254 -- Fixed return value of Exists() with empty queryset.
Thanks Simon Charette for reviews.
This commit is contained in:
committed by
Mariusz Felisiak
parent
7eb5391b71
commit
246eb4836a
@@ -1017,6 +1017,14 @@ class NonAggregateAnnotationTestCase(TestCase):
|
||||
],
|
||||
)
|
||||
|
||||
def test_annotation_exists_none_query(self):
|
||||
self.assertIs(
|
||||
Author.objects.annotate(exists=Exists(Company.objects.none()))
|
||||
.get(pk=self.a1.pk)
|
||||
.exists,
|
||||
False,
|
||||
)
|
||||
|
||||
def test_annotation_exists_aggregate_values_chaining(self):
|
||||
qs = (
|
||||
Book.objects.values("publisher")
|
||||
|
||||
Reference in New Issue
Block a user