12 messages in com.googlegroups.pylons-discussRe: Testing with the session object
FromSent OnAttachments
Marin27 Jun 2008 06:33 
Shannon -jj Behrens28 Jun 2008 04:17 
Marin28 Jun 2008 05:06 
Jonathan Vanasco28 Jun 2008 07:19 
Mike Orr28 Jun 2008 10:53 
Wichert Akkerman28 Jun 2008 11:00 
Marin29 Jun 2008 03:09 
Marin29 Jun 2008 03:20 
Wichert Akkerman29 Jun 2008 08:16 
Marin30 Jun 2008 04:34 
Marin30 Jun 2008 05:23 
Jonathan Vanasco07 Jul 2008 12:25 
Subject:Re: Testing with the session object
From:Marin (mari@gmail.com)
Date:06/30/2008 04:34:04 AM
List:com.googlegroups.pylons-discuss

I discovered why this code that was given in http://groups.google.com/group/pylons-discuss/browse_thread/thread/ec52fe65b960567/12b36231ff4dfb97?hl=en&lnk=gst&q=unit#12b36231ff4dfb97 does not work.

def test_session(self): import pylons

pylons.session._push_object({'user':'user_id'}) response = self.app.get(url_for('/')) pylons.session._pop_object()

This code puts the dictionary on the session stack, but then another object is pushed on the stack in pylons/wsgiapp.py:146 from the environ['pylons.environ_config']['session'] If you do a session._pop_object() in you controller you pop out the empty session and get your session on the top of the stack. It works, but I still want to find a cleaner way of doing it.