Fix error in send_file helper (#2003)
* Fix error in send_file (mimetype_filename is not defined) * fix formatting error message in send_file
This commit is contained in:
parent
96b6345c1a
commit
92ce20eeac
2 changed files with 7 additions and 3 deletions
|
|
@ -398,10 +398,14 @@ class TestSendfile(object):
|
|||
with app.test_request_context():
|
||||
with pytest.raises(ValueError) as excinfo:
|
||||
flask.send_file(StringIO("LOL"))
|
||||
|
||||
assert 'Unable to infer MIME-type' in str(excinfo)
|
||||
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)
|
||||
|
||||
def test_send_file_object(self):
|
||||
app = flask.Flask(__name__)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue