@Test
public void testDeleteParents() throws Exception
{

    try {
        context.turnOffAuthorisationSystem();
        b = bundleService.find(context, b.getID());
        if(b != null)
        {
            itemService.removeBundle(context, item, b);
        }
        item = itemService.find(context, item.getID());
        collection = collectionService.find(context, collection.getID());
        owningCommunity = communityService.find(context, owningCommunity.getID());
        collectionService.removeItem(context, collection, item);
        communityService.removeCollection(context, owningCommunity, collection);
        communityService.delete(context, owningCommunity);
        context.restoreAuthSystemState();
    } catch (SQLException | AuthorizeException | IOException ex) {
        log.error("SQL Error in destroy", ex);
        fail("SQL Error in destroy: " + ex.getMessage());
    }
}