Make some imports

    >>> from Products.CMFPlone.utils import getToolByName
    >>> from zope.component import getMultiAdapter, getUtility
    >>> from plone.portlets.interfaces import IPortletManager
    >>> from plone.portlets.interfaces import IPortletAssignmentMapping


    >>> portal = layer['portal']

Add a Blog content item

    >>> portal.invokeFactory('Blog', 'b1')
    'b1'
    >>> b1 = portal.get('b1')
    >>> b1.processForm()
    >>> b1
    <Blog at ...>

Now it should automaticly create the categories folder
    >>> cat_folder = b1.get('categories')
    >>> cat_folder
    <BlogCategory at ...>

and also some portlets must be set autmaticly on the blog
    >>> portlet_manager = getUtility(IPortletManager,name='plone.rightcolumn',context=b1)
    >>> map(str, portlet_manager['content_type']['Blog'].keys())
    ['blog-categories', 'tagcloud', 'blog-archive']
    >>> map(str, portlet_manager['content_type']['BlogEntry'].keys())
    ['blog-categories', 'tagcloud', 'blog-archive']
    >>> map(str, portlet_manager['content_type']['BlogCategory'].keys())
    ['blog-categories', 'tagcloud', 'blog-archive']


add a blogentry
    >>> b1.invokeFactory('BlogEntry', 'BlogEntry1')
    'BlogEntry1'
    >>> BlogEntry1 = b1.get('BlogEntry1')
    >>> BlogEntry1.processForm()
    >>> BlogEntry1
    <BlogEntry at ...>

add a image in blogentry
    >>> BlogEntry1.invokeFactory('Image', 'testimg')
    'testimg'
    >>> testimg = BlogEntry1.get('testimg')
    >>> testimg
    <ATImage at ...>

add a image to content item
    >>> allowed_types = [ a.content_meta_type for a in b1.allowedContentTypes()]
    >>> 'Image' not in allowed_types
    True
