Hi all,
this may be a dumb question, but after a lot of googling and looking
around at paste.registry and such, I can't figure it out.  I found one
spot on the pylons docs that gave a partial solution, but it was
commented heavily saying "don't use this, as it turns out it's
broken".  I tried it, because i'm like that, and they were right, it
was broken.

I have an application that, as you might imagine, requires a bit of
authentication.  This, however, forces me to, in my setUp method, run
a (at this point fairly standardized) hook to my login page, login
with a tester user, so that i can then proceed to actually test my
controllers.

the issue is that, as you might imagine, my __before__ method checks
for a user id in the session, and if not, redirects to login.  what i
would like to do (i'm admitting my rails test background here) like to
be able to explicitly set some attributes in the session from my test
controller, beforehand, so that i don't have to actually post to the
login page every time i want to test my controller.  certainly the
user/client/roles structure would already have to have been created
for the tests to actually work, but that's not a problem.  it's more
the ability to set an attribute in the session *before* post.

I've tried to just get response.session from a non-protected url on my
site, and save the values i want back into that session, but that
doesn't work.  I've read through as much of the auto-magic of
pylons.session, the registry manager, and the stacked object proxy,
but since all of that seems to be involved in what, in my test cases,
is located under self.app, I don't really know how to make session
data available before a post.

And, it may not be, i dont' really know.  I just know that in rails
test cases, i can just say "hey, i want object id x to be in the
session as this kw/val pair" and it shows up, and i like to think that
anything rails can do, we can make pylons do ;)

Thanks everyone!
Pete

-- 
"All guilt is relative, loyalty counts, and never let your conscience
be your guide."
  - Lucas Buck, American Gothic

_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to