This tests the behaviour when removing multiple referenced files (or
actually images).  The resulting confirmation pages should contain
lists of all link integrity breaches that would result from removing
the respective file.  First we need to create the necessary links:

  >>> self.setRoles(('Manager',))
  >>> p = self.portal
  >>> self.setText(p.doc1, p.image1.tag() + ', ' + p.image2.tag())
  >>> self.setText(p.doc2, p.image1.tag() + ', ' + p.image3.tag())

Then we use a browser to try to delete the referenced images.  Before we
can do this we need to prevent the test framework from choking on the
exception we intentionally throw (see docs/testRemovalTriggersConfirmation.txt
for more info).  Also, we disable the event count helper (as set in
folder_contents), so that all tests written so far won't need modification:

  >>> self.setStatusCode('LinkIntegrityNotificationException', 200)
  >>> self.disableEventCountHelper()
  >>> browser = self.getBrowser(loggedIn=True)
  >>> browser.post('http://nohost/plone/folder_delete?paths:list=image1&paths:list=image2&paths:list=image3&_authenticator=' + self.getAuthenticator(), '')
  >>> browser.contents
  '...<a href="http://nohost/plone/image1"...Test Image 1...
   ...This...Image...is referenced by the following items:...
   ...<li>...href="http://nohost/plone/doc1"...Test Page 1...</li>...
   ...<li>...href="http://nohost/plone/doc2"...Test Page 2...</li>...
   ...Would you like to delete it anyway?...'
  >>> browser.getControl(name='delete').click()

Since separate events are fired for every item deleted by `manage_delObjects`
there is no way to handle all potential integrity breaches in one single form,
at least no general way. Therefore we are presented with several forms asking
for confirmation in regard to breaches caused by deleting the individual
items:

  >>> browser.contents
  '...<a href="http://nohost/plone/image2"...Test Image 2...
   ...This...Image...is referenced by the following items:...
   ...<li>...href="http://nohost/plone/doc1"...Test Page 1...</li>...
   ...Would you like to delete it anyway?...'
  >>> browser.getControl(name='delete').click()
  >>> browser.contents
  '...<a href="http://nohost/plone/image3"...Test Image 3...
   ...This...Image...is referenced by the following items:...
   ...<li>...href="http://nohost/plone/doc2"...Test Page 2...</li>...
   ...Would you like to delete it anyway?...'
  >>> browser.getControl(name='delete').click()

After we acknowledge the breaches in link integrity the images should have
been deleted:

  >>> portal.image1
  Traceback (most recent call last):
  ...
  AttributeError: image1
  >>> portal.image2
  Traceback (most recent call last):
  ...
  AttributeError: image2
  >>> portal.image3
  Traceback (most recent call last):
  ...
  AttributeError: image3

