'Delete queries can safely contain sliced subqueries'

def test_sliced_delete(self):

    try:
        DumbCategory.objects.filter(id__in=DumbCategory.objects.order_by(u'-id')[0:1]).delete()
        self.assertEqual(set(DumbCategory.objects.values_list(u'id', flat=True)), set([1, 2, 3]))
        DumbCategory.objects.filter(id__in=DumbCategory.objects.order_by(u'-id')[1:2]).delete()
        self.assertEqual(set(DumbCategory.objects.values_list(u'id', flat=True)), set([1, 3]))
        DumbCategory.objects.filter(id__in=DumbCategory.objects.order_by(u'-id')[1:]).delete()
        self.assertEqual(set(DumbCategory.objects.values_list(u'id', flat=True)), set([3]))
    except DatabaseError as e:
        self.assertFalse(connections[DEFAULT_DB_ALIAS].features.allow_sliced_subqueries, str(e))
