failing test for streaming session
This commit is contained in:
parent
49f3e96844
commit
5978a0f55f
1 changed files with 14 additions and 0 deletions
|
|
@ -861,6 +861,20 @@ class TestStreaming(object):
|
||||||
assert rv.data == b'Hello World!'
|
assert rv.data == b'Hello World!'
|
||||||
assert called == [42]
|
assert called == [42]
|
||||||
|
|
||||||
|
def test_stream_keeps_session(self, app, client):
|
||||||
|
@app.route('/')
|
||||||
|
def index():
|
||||||
|
flask.session['test'] = 'flask'
|
||||||
|
|
||||||
|
@flask.stream_with_context
|
||||||
|
def gen():
|
||||||
|
yield flask.session['test']
|
||||||
|
|
||||||
|
return flask.Response(gen())
|
||||||
|
|
||||||
|
rv = client.get('/')
|
||||||
|
assert rv.data == b'flask'
|
||||||
|
|
||||||
|
|
||||||
class TestSafeJoin(object):
|
class TestSafeJoin(object):
|
||||||
def test_safe_join(self):
|
def test_safe_join(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue