======================
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

Let's log in using a browser.
    >>> browser = self.getLoggedInBrowser()

Now see if the Anonymous Preview tab is there
    >>> '<a href="%s/front-page/@@anonymousview">Anonymous View</a>' % self.portal.absolute_url() in browser.contents
    True

Now open the link and see if we see the edit tabs etc or not.
    >>> browser.open("%s/@@anonymousview" % self.portal.absolute_url())
    >>> not """<ul id="content-views" class="contentViews">""" in browser.contents
    True
