Fixed stream_with_context if decorated function has parameters

This commit is contained in:
Shipeng Feng 2016-04-02 07:17:45 +08:00 committed by David Lord
parent 9a80fe691d
commit cc536c8a7b
2 changed files with 4 additions and 4 deletions

View file

@ -683,11 +683,11 @@ class TestStreaming(object):
@app.route('/')
def index():
@flask.stream_with_context
def generate():
yield 'Hello '
def generate(hello):
yield hello
yield flask.request.args['name']
yield '!'
return flask.Response(generate())
return flask.Response(generate('Hello '))
c = app.test_client()
rv = c.get('/?name=World')
assert rv.data == b'Hello World!'