Ticket #29630: 29630_different_tables.diff

File 29630_different_tables.diff, 825 bytes (added by Mariusz Felisiak, 6 years ago)
  • tests/queries/tests.py

    diff --git a/tests/queries/tests.py b/tests/queries/tests.py
    index 384bda4c77..35cbbe29a7 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_columns_with_the_same_name_slice(self):
     1927        self.assertEqual(
     1928            list(Tag.objects.order_by('name').values_list('name', 'category__name')[:2]),
     1929            [('t1', 'Generic'), ('t2', 'Generic')],
     1930        )
     1931        self.assertQuerysetEqual(
     1932            Tag.objects.order_by('name').select_related('category')[:2],
     1933            ['<Tag: t1>', '<Tag: t2>']
     1934        )
     1935
    19261936
    19271937class RawQueriesTests(TestCase):
    19281938    def setUp(self):
Back to Top