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

  >>> self.setRoles(['Manager'])
  >>> topic=portal[portal.invokeFactory('Topic', id='testtopic', title='Title')]

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.CMFCore.utils import getToolByName
  >>> portal_types = getToolByName(topic, 'portal_types')
  >>> topic_type = getattr(portal_types, topic.portal_type)
  >>> topic_type.filter_content_types = False

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

Now we can upload our image:

  >>> _ = topic.invokeFactory('Image', id='image1', image=img)
  >>> topic.restrictedTraverse('image_thumb')
  <Image at ...>

