===================
ATTopic integration
===================

    >>> from Testing.testbrowser import Browser
    >>> browser = Browser()

    >>> self.setRoles(['Manager'])
    >>> from Products.CMFCore.utils import getToolByName
    >>> portal_types = getToolByName(portal, 'portal_types')
    >>> topic_type = getattr(portal_types, 'Topic')
    >>> topic_type.filter_content_types = False
    >>> topic_type.global_allow = True

    >>> topic=portal[portal.invokeFactory('Topic', id='testtopic')]
    >>> portal.portal_workflow.doActionFor(topic, 'publish')

ATTopics should have a working ImageView adapter that takes the first image
inside it. By default, you're not allowed to add images inside ATTopics, so
we enable that temporarily.

    >>> from Products.ATContentTypes.interface import IATTopic
    >>> IATTopic.providedBy(topic)
    True

Now we can upload our image:

    >>> _ = topic.invokeFactory('Image', id='image1', image=img)
    >>> browser.open('http://localhost/plone/testtopic/image_thumb')
    >>> "PNG" in browser.contents
    True
