summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Charette <charettes@users.noreply.github.com>2018-02-08 09:59:25 -0500
committerTim Graham <timograham@gmail.com>2018-02-08 09:59:25 -0500
commitd61fe246015aa4fdc6dcb837ffb1442fa71ae586 (patch)
tree1e9a51bc460cde84f6bd8975569fe40cf94ec830 /tests
parent01bfa9219b921267a8b94ed77e5984f9ce15497a (diff)
Fixed #29108 -- Fixed crash in aggregation of distinct+ordered+sliced querysets.
Regression in 4acae21846f6212aa992763e587c7e201828d7b0. Thanks Stephen Brooks for the report.
Diffstat (limited to 'tests')
-rw-r--r--tests/queries/tests.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/queries/tests.py b/tests/queries/tests.py
index ba2e6830f8..d0bf13413c 100644
--- a/tests/queries/tests.py
+++ b/tests/queries/tests.py
@@ -1918,6 +1918,9 @@ class Queries6Tests(TestCase):
qs = Tag.objects.exclude(category=None).exclude(category__name='foo')
self.assertEqual(str(qs.query).count(' INNER JOIN '), 1)
+ def test_distinct_ordered_sliced_subquery_aggregation(self):
+ self.assertEqual(Tag.objects.distinct().order_by('category__name')[:3].count(), 3)
+
class RawQueriesTests(TestCase):
def setUp(self):