[Zope] ZopeTestCase

Stefan H. Holek stefan at epy.co.at
Wed Jan 21 13:15:39 EST 2004


Hello Sylvain,

The "Bad Request" is usually a sign that you are committing in 
afterSetUp(). You *may* do that, but only if you override beforeClose() 
to commit the cleaned-up state as well. Also see the testWebserver.py 
example test.

Webunit uses a separate ZODB connection from the one ZTC opens for its 
tests. If you want to see the changes made by the webunit request, you 
have to call self._app() again. There is nothing wrong with that.

hth,
Stefan


On Mittwoch, Jän 21, 2004, at 15:36 Europe/Vienna, Sylvain Thénault 
wrote:

> Bad Request: The id "test_folder_1_" is invalid--it is already in use.
>
>    Note I don't have a tearDown method defined in my own test classe.
>
>  - I'm using ZopeTestCase in combinaison with mechanicalcat [1] to do
>    some functionnal tests. Using mechanicalcat to post a form which
>    leads to some objects modifications (objects which had have been
>    created in the afterSetUp method) works fine. The problem is that if
>    I access to those objects using self.app, I get the old version of
>    the object, but I get the updated version using self._app().
>
> I guess I'm missing something with both problem... Any idea ?
>
--
The time has come to start talking about whether the emperor is as well
dressed as we are supposed to think he is.               /Pete McBreen/




More information about the Zope mailing list