Permalink
Browse files

test session+redirect. #36

  • Loading branch information...
1 parent b1417f5 commit a82374e2ec8910730f671a7ee734f4dd7cb35067 @anandology anandology committed May 3, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 test/session.py
View
@@ -15,6 +15,16 @@ class reset(app.page):
def GET(self):
session.kill()
return ""
+
+ class redirect(app.page):
+ def GET(self):
+ session.request_token = '123'
+ raise web.redirect('/count')
+
+ class get_session(app.page):
+ path = "/session/(.*)"
+ def GET(self, name):
+ return session[name]
self.app = app
self.session = session
@@ -51,6 +61,12 @@ def testBadSessionId(self):
cookie.value = '/etc/password'
self.assertEquals(b.open('/count').read(), '1')
+ def testRedirect(self):
+ b = self.app.browser()
+ b.open("/redirect")
+ b.open("/session/request_token")
+ assert b.data == '123'
+
class DBSessionTest(SessionTest):
"""Session test with db store."""
def make_session(self, app):

0 comments on commit a82374e

Please sign in to comment.