forked from orbit-oss/flask
Add session to RequestContext.copy()
This commit is contained in:
parent
7e714bd28b
commit
e08bcf9f97
3 changed files with 22 additions and 6 deletions
|
|
@ -156,6 +156,7 @@ class TestGreenletContextCopying(object):
|
|||
|
||||
@app.route('/')
|
||||
def index():
|
||||
flask.session['fizz'] = 'buzz'
|
||||
reqctx = flask._request_ctx_stack.top.copy()
|
||||
|
||||
def g():
|
||||
|
|
@ -166,6 +167,7 @@ class TestGreenletContextCopying(object):
|
|||
assert flask.current_app == app
|
||||
assert flask.request.path == '/'
|
||||
assert flask.request.args['foo'] == 'bar'
|
||||
assert flask.session.get('fizz') == 'buzz'
|
||||
assert not flask.request
|
||||
return 42
|
||||
|
||||
|
|
@ -183,6 +185,7 @@ class TestGreenletContextCopying(object):
|
|||
|
||||
@app.route('/')
|
||||
def index():
|
||||
flask.session['fizz'] = 'buzz'
|
||||
reqctx = flask._request_ctx_stack.top.copy()
|
||||
|
||||
@flask.copy_current_request_context
|
||||
|
|
@ -191,6 +194,7 @@ class TestGreenletContextCopying(object):
|
|||
assert flask.current_app == app
|
||||
assert flask.request.path == '/'
|
||||
assert flask.request.args['foo'] == 'bar'
|
||||
assert flask.session.get('fizz') == 'buzz'
|
||||
return 42
|
||||
|
||||
greenlets.append(greenlet(g))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue