Previously Marin wrote:
> On Jun 28, 8:01 pm, Wichert Akkerman <[EMAIL PROTECTED]> wrote:
> > I found that when you are writing unit tests it is essential to be able to
> > stuff data into session, c and request. I'm using a base class for
> > unittests which looks like this:
> >
> >     from unittest import TestCase
> >     from paste.registry import Registry
> >     import pylons
> >     from pylons.util import ContextObj
> >     from pylons.controllers.util import Request
> >
> >     class PylonsTestCase(TestCase):
> >         """A basic test case which allows access to pylons.c and 
> > pylons.request.
> >         """
> >
> >         def setUp(self):
> >             self.registry=Registry()
> >             self.registry.prepare()
> >
> >             self.context_obj=ContextObj()
> >             self.registry.register(pylons.c, self.context_obj)
> >
> >             self.request_obj=Request(dict(HTTP_HOST="nohost"))
> >             self.registry.register(pylons.request, self.request_obj)
> >
> > it probably isn't difficult to add session support to that.
> 
> I am trying to add the session (StackedObjectProxy) but you code does
> not  'compile'. There is no Request in pylons.controllers.util
> Have you typed it correctly?

It's there in Pylons 0.9.7beta5. No idea where previous versions put it,
but a quick grep should tell you.

Wichert.

-- 
Wichert Akkerman <[EMAIL PROTECTED]>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to