Can the testbrowser handle REQUEST.SESSION?

Rodrigo Bernardo Pimentel rbp at isnomore.net
Mon Oct 22 19:56:54 UTC 2007


Maurits van Rees <m.van.rees at zestsoftware.nl> wrote:

> Andreas Jung, on 2007-10-20:

>> --On 19. Oktober 2007 22:29:35 -0200 Rodrigo Bernardo Pimentel wrote:
>>> I have a product with one particular python script that, at a certain
>>> point, needs to set a value in SESSION. That seems to work fine when I
>>> try the product  manually, but, when I was writing functional doctests
>>> for it using the testbrowser, I get an AttributeError saying that SESSION
>>> doesn't exist. I tried creating a FakeRequestSession on app.REQUEST on
>>> the doctest but that didn't help.

>> At least in ZopeTestCase you have to call setupCoreSessions() within your
>> afterSetUp() method..check the spelling for the ZTC docs.

> http://getpaid.googlecode.com/svn/trunk/products/PloneGetPaid/tests/base.py
>
> So Rodrigo: you can look there for inspiration.

Works like a charm! Thanks, Andreas and Maurits :)



         rbp
-- 
  http://isnomore.net


----------------------------------------------------------------





More information about the Product-Developers mailing list