Ticket #29630: 29630.diff

File 29630.diff, 822 bytes (added by Mariusz Felisiak, 6 years ago)

Test

  • tests/queries/tests.py

    diff --git a/tests/queries/tests.py b/tests/queries/tests.py
    index 384bda4c77..ae126c3c9f 100644
    a b class Queries6Tests(TestCase):  
    19231923    def test_distinct_ordered_sliced_subquery_aggregation(self):
    19241924        self.assertEqual(Tag.objects.distinct().order_by('category__name')[:3].count(), 3)
    19251925
     1926    def test_multiple_columns_with_the_same_name_slice(self):
     1927        self.assertEqual(
     1928            list(Tag.objects.order_by('-name').values_list('name', 'parent__name')[:2]),
     1929            [('t5', 't3'), ('t4', 't3')],
     1930        )
     1931        self.assertQuerysetEqual(
     1932            Tag.objects.order_by('-name').select_related('parent')[:2],
     1933            ['<Tag: t5>', '<Tag: t4>']
     1934        )
     1935
    19261936
    19271937class RawQueriesTests(TestCase):
    19281938    def setUp(self):
Back to Top