I have looked trough about 10 source files of pylons, paste, routes
etc. It seems there is no nice way of putting things in the session.
So, here is an almost clean way (disregarding the contamination of
controller code)

def test_index(self):
        extra_environ = {}
        extra_environ['test.session']= dict(user='id')
        response = self.app.get(url_for(controller='index'),
extra_environ=extra_environ)

class IndexController(BaseController):
    def __before__(self):
        if 'test.session' in request.environ:
            session.update(request.environ['test.session'])

If someone thinks there is a nicer way of unittesting controllers i
would like to hear it.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
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