collective.sharerizer
====================

Get a test browser.

  >>> from Products.Five.testbrowser import Browser
  >>> browser = Browser()

No special action in doc actions to begin with...

  >>> browser.open('http://nohost/plone')
  >>> "document-action-sharerizer" in browser.contents
  False

Let's configure it.

  >>> self.app.acl_users.userFolderAddUser('root', 'secret', ['Manager'], [])
  >>> browser.addHeader('Authorization', 'Basic root:secret')
  >>> browser.open('http://nohost/plone/@@sharerizer-controlpanel')
  >>> browser.getControl(name='form.code').value = "My Service's Code"
  >>> browser.getControl('Save').click()

  >>> browser.open('http://nohost/plone')

Now the action appears in document actions

  >>> "document-action-sharerizer" in browser.contents
  True

Furthermore, our pasted code is there too.

  >>> "My Service's Code" in browser.contents
  True

Now we restrict the content types where the code is shown.  We set no
types, so it will not be visible anywhere.

  >>> browser.open('http://nohost/plone/@@sharerizer-controlpanel')
  >>> browser.getControl(name='form.restrict').value = True
  >>> browser.getControl('Save').click()

Check the results.

  >>> browser.open('http://nohost/plone')
  >>> "document-action-sharerizer" in browser.contents
  False
  >>> "My Service's Code" in browser.contents
  False

I do not know how to test clicking the allowed_types control, so let's
do that outside of the browser.

  >>> self.portal.portal_properties.sharerizer._updateProperty('allowed_types', ['Document'])

Check the results.  The front page shows our code.

  >>> browser.open('http://nohost/plone')
  >>> "document-action-sharerizer" in browser.contents
  True
  >>> "My Service's Code" in browser.contents
  True

When looking at the Plone Site directy, nothing is shown.

  >>> browser.open('http://nohost/plone/view')
  >>> "document-action-sharerizer" in browser.contents
  False
  >>> "My Service's Code" in browser.contents
  False



