
Setup
-----

  >>> self.portal.portal_quickinstaller.installProduct('plone.app.iterate')
  ''

  >>> from Products.Five.testbrowser import Browser
  >>> from Testing.ZopeTestCase import user_password
  >>> browser = Browser()
  >>> browser.addHeader('Authorization',
  ...                   'Basic %s:%s' % ('portal_owner', user_password))

Create a document
-----------------

Go to our folder and create a document:

  >>> browser.open(self.portal.absolute_url())
  >>> browser.getLink('Add new').click()
  >>> 'Add new item' in browser.contents
  True
  >>> browser.getControl('Page').click()
  >>> browser.getControl('Add').click()
  >>> browser.getControl('Title').value = 'Hello, World!'
  >>> browser.getControl('Body Text').value = 'Hello, World!'
  >>> browser.getControl('Save').click()
  >>> 'Changes saved.' in browser.contents
  True

Check it out
------------

Let's check out the document.  For this, we'll go to the *Check out*
form directly.  From there, we'll check out to the parent folder:

  >>> browser.open(browser.url + '/@@content-checkout')
  >>> 'This is a working copy' in browser.contents
  True
  >>> browser.url
  'http://nohost/plone/copy_of_hello-world'

When viewing the original document, we should see a note that
someone's working on a working copy:

  >>> browser.open('http://nohost/plone/hello-world')
  >>> 'This item is being edited' in browser.contents
  True

We'll now edit the working copy and save it:

  >>> browser.open('http://nohost/plone/copy_of_hello-world/edit')
  >>> browser.getControl('Title').value = 'Hello, World! version 2.0'
  >>> browser.getControl('Save').click()
  >>> 'Changes saved.' in browser.contents
  True
  >>> browser.url
  'http://nohost/plone/copy_of_hello-world'

Check it in
-----------

Now that we've made our changes we'll check the working copy in:

  >>> browser.open(browser.url + '/@@content-checkin')
  >>> browser.getControl('Check in').click()
  >>> 'Checked in' in browser.contents
  True
  >>> browser.url
  'http://nohost/plone/hello-world'
  >>> 'Hello, World! version 2.0' in browser.contents
  True
