Was having trouble with this too, thanks for find this!

On Friday, April 8, 2011 7:03:21 AM UTC-7, Jérémie wrote:
>
> Some more points. 
>
> I finally succeeded to reset request thanks to matclab's comments and 
> code on the slice (http://www.web2pyslices.com/main/slices/take_slice/ 
> 67) : 
> >> "note that without pickling at init and unpickling at setup, the 
> session and request was not cleaned up before each test." 
>
> class DefaultController(unittest.TestCase): 
>     def __init__(self, p): 
>         global auth, session, request 
>         unittest.TestCase.__init__(self, p) 
>         self.session = pickle.dumps(session) 
>         request.application = 'appname' 
>         request.controller = 'default' 
>         self.request = pickle.dumps(request) 
>
>
>     def setUp(self): 
>         global response, session, request, auth 
>         session = pickle.loads(self.session) 
>         request = pickle.loads(self.request) 
>         auth = Auth(globals(), db) 
>         auth.define_tables() 
>
>
> In case anybody would need it. 
>
> Jérémie

-- 



Reply via email to