This tests ensures that link integrity is correctly setup when cloning an object. First we need to set up a link: >>> self.setRoles(('Manager',)) >>> self.setText(portal.doc1, 'a document') Next we clone the document: >>> portal.doc1.object_copy() 'http://nohost/plone/doc1/' >>> portal.object_paste() 'http://nohost/plone/' >>> browser = self.getBrowser(loggedIn=True) >>> browser.open('http://nohost/plone/folder_contents') >>> browser.contents '...... ...... ......' Then we try to delete the document linked by the original document and its clone. 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): >>> self.setStatusCode('LinkIntegrityNotificationException', 200) Now we can continue and "click" the "delete" action. The confirmation page should list both documents: >>> browser.getControl('Test Page 2').selected = True >>> browser.getControl('Delete').click() >>> browser.contents '...
... ......href="http://nohost/plone/copy_of_doc1"...Test Page 1...... ...
  • ...href="http://nohost/plone/doc1"...Test Page 1...
  • ... ...Would you like to delete it anyway?...'