======================
An integration doctest
======================

Test the collective.anonymousview package 

Let's check if the portal object exists

    >>> self.portal
    <PloneSite at ...>

And see if the collective.anonymousview product is installed

    >>> portal_quickinstaller = self.portal.portal_quickinstaller
    >>> 'collective.anonymousview' in  portal_quickinstaller.objectIds()
    True

Now see if the Anonymous Preview tab is there
    >>> from Products.Five.testbrowser import Browser
    >>> from Products.PloneTestCase.setup import portal_owner, default_password
    >>> browser = Browser()
    >>> browser.open(self.portal.absolute_url())
    >>> browser.getControl(name='__ac_name').value = portal_owner
    >>> browser.getControl(name='__ac_password').value = default_password
    >>> browser.getControl(name='submit').click()
    >>> '<a href="http://nohost/plone/front-page/@@anonymousview">Anonymous View</a>' in browser.contents
    True
    
We want to test the anonymous preview here, but the browserview itself does not
know about http://nohost, so the urllib call there fails. Need to find a solution
for this.


