[Zope-Coders] Re: Testing from an INSTANCE_HOME

Philipp von Weitershausen philipp@weitershausen.de
Sun, 08 Jun 2003 17:21:39 +0200


Chris Withers wrote:
> Lennart Regebro wrote:
> 
>>
>> And makeing a serach and replace in a bunch of tests from Zope.app() 
>> to Testing.app() IS trivial. Besides, everybody should start using 
>> ZopeTestCase anyway, which is a bigger change. ;)
> 
> What's this and why should we be using it?

http://www.zope.org/Members/shh/ZopeTestCase

It is a unit test framework built on top of PyUnit and the Testing 
package. It allows you to write unit tests for Zope2 products.

While in Zope3, you may import and instanciate parts of the application 
without having to run the application, this is not possible in Zope2. 
Therefore, ZopeTestCase fires up a minimal Zope instance before it runs 
your unit tests and provides a hook to install certain products into 
that minimal Zope instance. This way, you may add folders, PageTemplates 
or custom objects and even test things like acquisition in case your 
code depends on it.

I would even go further than Lennart and propose:

Put ZopeTestCase into core just like we want to with ZopeProfiler!

Philipp