Merge pull request #2019 from pallets/bugfix/sendfile-error

Do not cause errors for unknown files for sendfile
This commit is contained in:
Armin Ronacher 2016-09-12 21:52:42 +03:00 committed by GitHub
commit a40489e0ce
3 changed files with 5 additions and 11 deletions

View file

@ -402,9 +402,7 @@ class TestSendfile(object):
assert 'no filename is available' in str(excinfo)
with app.test_request_context():
with pytest.raises(ValueError) as excinfo:
flask.send_file(StringIO("LOL"), attachment_filename='filename')
assert "Unable to infer MIME-type from filename 'filename'" in str(excinfo)
flask.send_file(StringIO("LOL"), attachment_filename='filename')
def test_send_file_object(self):
app = flask.Flask(__name__)