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

2005-10-07 Thread Stefan H. Holek

Exactly!

ZopeTestCase (CMFTestCase, PloneTestCase) was designed for testing  
*applications*. As you say, when I write a CMF application I should  
be able to assume the CMF below works. In this case a "fat fixture"  
makes perfect sense (to me). Also, I firmly believe application  
developers should not need to dig deep into the framework just to be  
able to write some tests; this was my motivation for starting ZTC in  
the first place.


I am not in the business of shoving CMFTestCase down anybody's  
throat. CMFCore.tests.base has everything CMF-the-framework needs,  
and SecurityRequestTest provides basically the same fixture you would  
get from using ZTC (app object, transaction, request, and security  
context).


Whether tests you write turn out to be unit or integration tests does  
not depend on the test framework, IMO. It depends on where you draw  
the line in the stack.


Stefan


On 6. Okt 2005, at 17:47, Tres Seaver wrote:


I do not believe that "trusting the stack" makes senses when trying to
test a component of the stack.  If you are writing tests for an
application (or higher layer) which *uses* the stack, then you can
safely trust it.  For instance, I'm willing to use OFS.SimpleItem and
OFS.Folder when building out a test jig, because they belong to a  
lower

layer of the stack, and have their own tests.


--
Anything that happens, happens.  --Douglas Adams


___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


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

2005-10-06 Thread Chris Withers

OK, so I misunderstood the actual problem Paul was reporting...

Can someone explain it for a stupid person like me? ;-)

Chris

Stefan H. Holek wrote:
Oh, setupCMFSite is sufficiently clever, it's the CMF tests that  aren't 
;-)


Stefan


On 5. Okt 2005, at 10:45, Chris Withers 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?



--
Anything that happens, happens.  --Douglas Adams




--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


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

2005-10-05 Thread Paul Winkler
Lennart Regebro said:
> On 10/5/05, Chris Withers <[EMAIL PROTECTED]> 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



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


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

2005-10-05 Thread Stefan H. Holek
Oh, setupCMFSite is sufficiently clever, it's the CMF tests that  
aren't ;-)


Stefan


On 5. Okt 2005, at 10:45, Chris Withers 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?


--
Anything that happens, happens.  --Douglas Adams


___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


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

2005-10-05 Thread Lennart Regebro
On 10/5/05, Chris Withers <[EMAIL PROTECTED]> 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?
>
> > 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 ;-)
>
> Chris

Any test including PortalTestCase should really not be seen as a unit
test, but a fucntional test. ;) 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...
--
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


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

2005-10-05 Thread Chris Withers

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?



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 ;-)

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests