def test_delete_related_shares_lotsofchildren(self):
        """Make sure the query splitting does it's job."""
        vgw = self.gw.get_root_gateway()
        dir1 = vgw.make_subdirectory(vgw.get_root().id, 'shared1')
        # make lots of children
        for i in xrange(300):
            vgw.make_subdirectory(dir1.id, 'd%s' % i)
        usera = make_storage_user(username='sharee1')
        sharea = vgw.make_share(dir1.id, 'sharea', user_id=usera.id)
        usera._gateway.accept_share(sharea.id)
        dir1 = StorageObject.objects.get(id=dir1.id)
        self.user._gateway.delete_related_shares(dir1)
        self.assertRaises(
            errors.DoesNotExist,
            self.user._gateway.get_share, sharea.id, accepted_only=False)