forked from orbit-oss/flask
Disable direct passthrough for accessing the data attribute on newer Werkzeugs
This commit is contained in:
parent
eb622fb34f
commit
8aaf302586
1 changed files with 2 additions and 0 deletions
|
|
@ -158,6 +158,7 @@ class SendfileTestCase(FlaskTestCase):
|
|||
self.assert_true(rv.direct_passthrough)
|
||||
self.assert_equal(rv.mimetype, 'text/html')
|
||||
with app.open_resource('static/index.html') as f:
|
||||
rv.direct_passthrough = False
|
||||
self.assert_equal(rv.data, f.read())
|
||||
rv.close()
|
||||
|
||||
|
|
@ -179,6 +180,7 @@ class SendfileTestCase(FlaskTestCase):
|
|||
with app.test_request_context():
|
||||
f = open(os.path.join(app.root_path, 'static/index.html'))
|
||||
rv = flask.send_file(f)
|
||||
rv.direct_passthrough = False
|
||||
with app.open_resource('static/index.html') as f:
|
||||
self.assert_equal(rv.data, f.read())
|
||||
self.assert_equal(rv.mimetype, 'text/html')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue