[Zope-CMF] Re: CMFTestCase: Best way to create the CMF site?

Paul Winkler pw_lists at slinkp.com
Wed Oct 5 16:08:15 EDT 2005


Lennart Regebro said:
> On 10/5/05, Chris Withers <chris at simplistix.co.uk> wrote:
>> Stefan H. Holek wrote:
>> > I see two options:
>> >
>> > a) Use a different portal name
>> >
>> >     portal_name = 'mysite'
>> >     CMFTestCase.setupCMFSite(portal_name)
>>
>> Can setupCMFSite not do something more clever if it finds the object
>> already there?

It simply doesn't do anything in that case.

>> > b) Use getPortal() to create a new portal per test
>> >
>> >     def getPortal(self):
>> >         manage_addCMFSite(self.app, portal_name)
>> >         return getattr(self.app, portal_name)
>>
>> ....hahaha, and watch your tests take hours to run ;-)

Maybe that way, but setupCMFSite() is pretty quick.

> Any test including PortalTestCase should really not be seen as a unit
> test, but a fucntional test. ;)

Regardless of which, we still need to run it :)

> If we could put in some effort of
> making a minimal dymmy-portal that can be deleted and recreated very
> quickly, then that would be very interesting. I would assume that that
> involved a lot of work though...

CMFTestCase's setupCMFSite() is already pretty quick.

-- 
Paul Winkler
http://www.slinkp.com





More information about the Zope-CMF mailing list