We need a view on the content.

    >>> request = self.app.REQUEST
    >>> from zope.publisher.browser import BrowserView
    >>> view = BrowserView(self.portal, request)

    >>> from plone.app.layout.viewlets.interfaces import IPortalFooter
    >>> from Products.Five.viewlet.manager import ViewletManager
    >>> Footer = ViewletManager('left', IPortalFooter)

Now we can instantiate the manager.

    >>> manager = Footer(self.portal, request, view)

Set analytics (webstats_js) code through the controlpanel

    >>> from plone.registry.interfaces import IRegistry
    >>> from zope.component import getUtility
    >>> from Products.CMFPlone.interfaces import ISiteSchema
    >>> registry = getUtility(IRegistry)
    >>> site_settings = registry.forInterface(ISiteSchema, prefix="plone")
    >>> site_settings.webstats_js = u"<script>window.title='Hello'</script>"
    >>> manager.update()
    >>> text = manager.render()
    >>> site_settings.webstats_js in text
    True

Now enter some non-ascii text

    >>> site_settings.webstats_js = u"<script>window.title='C\xedsa\u0159'</script>"
    >>> manager.update()
    >>> text = manager.render()
    >>> site_settings.webstats_js in text
    True
