forked from orbit-oss/flask
Fix test_send_file_object
static/index.html now opens in binary mode, and therefore newline conversion does not take place.
This commit is contained in:
parent
cff35237ef
commit
b7337080e4
1 changed files with 1 additions and 1 deletions
|
|
@ -260,7 +260,7 @@ class SendfileTestCase(FlaskTestCase):
|
||||||
app = flask.Flask(__name__)
|
app = flask.Flask(__name__)
|
||||||
with catch_warnings() as captured:
|
with catch_warnings() as captured:
|
||||||
with app.test_request_context():
|
with app.test_request_context():
|
||||||
f = open(os.path.join(app.root_path, 'static/index.html'))
|
f = open(os.path.join(app.root_path, 'static/index.html'), mode='rb')
|
||||||
rv = flask.send_file(f)
|
rv = flask.send_file(f)
|
||||||
rv.direct_passthrough = False
|
rv.direct_passthrough = False
|
||||||
with app.open_resource('static/index.html') as f:
|
with app.open_resource('static/index.html') as f:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue