mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #25894 -- Fixed evaluation of zero-length slices of QuerySet.values().
This commit is contained in:
committed by
Tim Graham
parent
423b3afce4
commit
69b69f6d60
@@ -2429,6 +2429,12 @@ class WeirdQuerysetSlicingTests(BaseQuerysetTest):
|
||||
def test_empty_sliced_subquery_exclude(self):
|
||||
self.assertEqual(Eaten.objects.exclude(food__in=Food.objects.all()[0:0]).count(), 1)
|
||||
|
||||
def test_zero_length_values_slicing(self):
|
||||
n = 42
|
||||
with self.assertNumQueries(0):
|
||||
self.assertQuerysetEqual(Article.objects.values()[n:n], [])
|
||||
self.assertQuerysetEqual(Article.objects.values_list()[n:n], [])
|
||||
|
||||
|
||||
class EscapingTests(TestCase):
|
||||
def test_ticket_7302(self):
|
||||
|
||||
Reference in New Issue
Block a user