Functional testing: The object at x has an empty or missing docstring.

by Mikko Ohtamaa last modified Dec 30, 2008 03:08 PM
You get error "Zope has encountered a problem publishing your object. The object at x has an empty or missing docstring."

Cause

__bobo_traverse__ fails in functional testing, because getattr("actionname") for Plone object returns None - The actions of your object are not accessible. This causes "missing doctstring" message, because None object has no docstring (surprise, error message is not very helpful). When using quick installer in  ATFunctionalSiteTestCase, method PortalTestCase._refreshSkinData() is not called. This is needed for action registration.

Solution

In your TestCase.afterSetup(), call PortalTestCase._refreshSkinData()

        self.qi = self.portal.portal_quickinstaller
        self.qi.installProduct('Archetypes')
        self.at = self.portal.archetype_tool
        self.qi.installProduct('PloneLocalFolderNG')
      
        # Calling this ensures that PloneLocalFolderNG actions are registered propeply
        self._refreshSkinData()