This tests checks that isLinked can now be used safely as it eventually plays
well with transaction machinery.

  >>> self.setRoles(('Manager',))
  >>> p = self.portal

Let's add an image.

  >>> import transaction
  >>> transaction.begin()
  <transaction...>
  >>> p.invokeFactory('Image', 'new_image')
  'new_image'
  >>> transaction.commit()

Check that it has been persisted.

  >>> browser = self.getBrowser(loggedIn=True)
  >>> browser.open('http://nohost/plone/folder_contents')
  >>> browser.contents
  '...<a href="http://nohost/plone/new_image/view"...'
  
Let's add a second image.

  >>> transaction.begin()
  <transaction...>
  >>> p = self.portal
  >>> p.invokeFactory('Image', 'another_image')
  'another_image'
  
Even though we use isLinked, 

  >>> from Products.CMFPlone.utils import isLinked
  >>> isLinked(p.another_image)
  False
  >>> transaction.commit()

the second image is also persisted.

  >>> browser = self.getBrowser(loggedIn=True)
  >>> browser.open('http://nohost/plone/folder_contents')
  >>> browser.contents
  '...<a href="http://nohost/plone/new_image/view"...
  ...<a href="http://nohost/plone/another_image/view"...'

Let's add a third image.

  >>> transaction.begin()
  <transaction...>
  >>> p = self.portal
  >>> p.invokeFactory('Image', 'another_new_image')
  'another_new_image'

Let's link it into a document.

  >>> self.setText(p.doc1, p.another_new_image.tag())

Even though we use isLinked, 

  >>> isLinked(p.another_new_image)
  True

the third image is also persisted.

  >>> browser = self.getBrowser(loggedIn=True)
  >>> browser.open('http://nohost/plone/folder_contents')
  >>> browser.contents
  '...<a href="http://nohost/plone/new_image/view"...
  ...<a href="http://nohost/plone/another_image/view"...
  ...<a href="http://nohost/plone/another_new_image/view"...'
