From c754bdc45bdcd9b2a03d4e3e10ea2a742456de91 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Tue, 8 Aug 2017 23:38:43 +0500 Subject: [PATCH] Refs #7070 -- Improved test for extra(), values(), distinct() and ordering() all together. Tested that the extra select that appears in the select clause only because of distinct() and order_by() doesn't appear in the result values. --- tests/extra_regress/tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/extra_regress/tests.py b/tests/extra_regress/tests.py index 53106fa249..e225d8cd62 100644 --- a/tests/extra_regress/tests.py +++ b/tests/extra_regress/tests.py @@ -433,4 +433,5 @@ class ExtraRegressTests(TestCase): self.assertSequenceEqual(qs.order_by('-second_extra'), [t2.pk, t1.pk]) # Note: the extra ordering must appear in select clause, so we get two # non-distinct results here (this is on purpose, see #7070). - self.assertSequenceEqual(qs.order_by('-second_extra').values_list('first', flat=True), ['a', 'a']) + # Extra select doesn't appear in result values. + self.assertSequenceEqual(qs.order_by('-second_extra').values_list('first'), [('a',), ('a',)])