Paul Winkler wrote:
Hi again :)
I'm trying to use CMFTestCase along with ZopeTestCase.Functional
to test my skin scripts.  But how do I get them set up
properly? Anybody have working examples of this?  I wondered
if there might be some in the Plone test suites but if so I
didn't find any.

Example that fails because "document_view" is 404:

class TestUI(CMFTestCase.CMFTestCase,

    """Test the skin scripts and templates.

    def getPortal(self):
        # Set up a CMF site.
        return getattr(, CMFTestCase.portal_name)

    def afterSetUp(self):
        self.basic_auth = '%s:%s' % (user_name, user_password)
        self.setRoles(['Manager', 'Member'])
        # Add a folder and a doc.
        self.portal.invokeFactory(type_name='Folder', id='folder1')
        self.fol1 = self.portal.folder1
        data = 'Testing ZSyncer Tool, blah blah blah'
        self.fol1.invokeFactory('Document', 'test_doc1',
                                title='nunya bizness',
        self.doc1 = self.fol1.test_doc1

    def test_DocView(self):
        url = self.doc1.absolute_url_path()
        import pdb; pdb.set_trace()
        response = self.publish(url, self.basic_auth)

Some stepping around with pdb reveals this:
(Pdb) n
-> request, bind=1)
(Pdb) n
NotFound: 'document_view'

Maybe adding the following in afterSetUp() will help.


Zope-CMF maillist  -

See for bug reports and feature requests

Reply via email to