RSS Views
---------

Set up site and enable syndication for the portal

    >>> from zope.component.hooks import setSite
    >>> setSite(app.site)
    >>> app.site.portal_syndication.enabled
    False
    >>> app.site.portal_syndication.enable()
    >>> app.site.portal_syndication.enabled
    True

Set up syndication for the folder

    >>> from Products.CMFCore.interfaces import ISyndicationInfo
    >>> from zope.component import getAdapter
    >>> info = getAdapter(app.site, ISyndicationInfo)
    >>> info.enabled
    False
    >>> info.enable()
    >>> info.enabled
    True

    >>> from Products.CMFDefault.Document import Document
    >>> obj_id = app.site._setObject('myDocument', Document('myDocument'))
    >>> obj = app.site[obj_id]
    >>> obj.portal_type = 'Document'
    >>> obj.setTitle('TITLE')
    >>> obj.setDescription('DESCRIPTION')

    >>> uf = app.site.acl_users
    >>> _ignored = uf._doAddUser('mgr', 'mgrpw', ['Manager'], [])

Create the browser object we'll be using.

    >>> from Testing.testbrowser import Browser
    >>> browser = Browser()
    >>> browser.handleErrors = False
    >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')

Get RSS Feed

    >>> browser.open("http://localhost/site/@@rss.xml")
    >>> browser.contents is not None
    True

Parse Feed
    >>> from xml.etree import ElementTree
    >>> feed = list(ElementTree.XML(browser.contents))[0]
    >>> feed.find("title").text == "Portal"
    True
    >>> feed.find("lastBuildDate").text == app.site.portal_syndication.getUpdateBase()
    True
    >>> item = feed.find("item")
    >>> item.find("title").text == "TITLE"
    True
    >>> item.find("description").text == "DESCRIPTION"
    True
    >>> item.find("pubDate").text == obj.modified().rfc822()
    True
