'Make sure that a cloned queryset maintains the custom delete()'

def test_cloned_queryset_delete(self):

    to_delete = ('host1', 'host2')
    for host in self.hosts:
        self.assertFalse(host.invalid)
    hosts = models.Host.objects.all().filter(hostname__in=to_delete)
    hosts.delete()
    all_hosts = models.Host.objects.all()
    self.assertEqual(all_hosts.count(), len(self.hosts))
    for host in all_hosts:
        if (host.hostname in to_delete):
            self.assertTrue(host.invalid, ('%s.invalid    expected    to    be    True' % host.hostname))
        else:
            self.assertFalse(host.invalid, ('%s.invalid    expected    to    be    False' % host.hostname))
