[Twisted-web] Creating contexts for Unit Tests

tarjei tarjei at nu.no
Wed Jul 25 06:49:29 EDT 2007

Colin Alston wrote:
> On 24/07/2007 20:10 tarjei wrote:
>> Hi, I've run into a problem related to testing my application.
> I can't quite understand why you're setting page.context. What I do is
> this..
Because the method I'm testing does not get context as a parameter in
the first place :-)

> ctx = context.WebContext(tag=page)
> ctx.remember(testutil.AccumulatingFakeRequest()) 

> Hope this helps in any way...
It did, I wasn't aware of testutil. It seems that my Nevow version
(0.9.0) was a bit old as well.

Thanks a lot. I'll see if I can add this to the Nevow faq (does it exist?)

BTW: Should new apps be written in conformance with this document:




More information about the Twisted-web mailing list