Skip to content.

plope

Personal tools
You are here: Home » Members » chrism's Home » Writing Bad Unit Tests » Example of mocking CMF
 
 

Comment

Above in this comment thread: Writing Bad Unit Tests » Unit, integration, mock

Example of mocking CMF

Posted by nouri at 2008-05-29 09:24 AM
I have a 13 lines example doctests here that creates a mocked CMF site and tests a content type's method that requires both the "portal_properties" tool and the "portal_catalog" to work. It's very simple to mock these. Mocky, the library I wrote to support this, makes it easy.

Look at the last example here: http://danielnouri.org/blog/devel/zope/plone-doctest-in-isolation.html