'Slice a query that has a sliced subquery'

def test_slice_subquery_and_query(self):

    query = DumbCategory.objects.filter(id__in=DumbCategory.objects.order_by('-id')[0:2])[0:2]
    self.assertEqual({x.id for x in query}, {3, 4})
    query = DumbCategory.objects.filter(id__in=DumbCategory.objects.order_by('-id')[1:3])[1:3]
    self.assertEqual({x.id for x in query}, {3})
    query = DumbCategory.objects.filter(id__in=DumbCategory.objects.order_by('-id')[2:])[1:]
    self.assertEqual({x.id for x in query}, {2})
