Merge remote-tracking branch 'origin/1.0-maintenance'

This commit is contained in:
David Lord 2019-01-07 10:00:10 -08:00
commit a74864ec22
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
5 changed files with 39 additions and 4 deletions

View file

@ -680,6 +680,8 @@ class TestSendfile(object):
(u'Ñandúpingüino.txt', '"Nandu/pinguino.txt"',
'%C3%91and%C3%BA%EF%BC%8Fping%C3%BCino.txt'),
(u'Vögel.txt', 'Vogel.txt', 'V%C3%B6gel.txt'),
# Native string not marked as Unicode on Python 2
('tést.txt', 'test.txt', 't%C3%A9st.txt'),
))
def test_attachment_filename_encoding(self, filename, ascii, utf8):
rv = flask.send_file('static/index.html', as_attachment=True, attachment_filename=filename)

View file

@ -184,6 +184,10 @@ def test_default_error_handler():
def forbidden():
raise Forbidden()
@app.route("/slash/")
def slash():
return "slash"
app.register_blueprint(bp, url_prefix='/bp')
c = app.test_client()
@ -191,5 +195,5 @@ def test_default_error_handler():
assert c.get('/bp/forbidden').data == b'bp-forbidden'
assert c.get('/undefined').data == b'default'
assert c.get('/forbidden').data == b'forbidden'
# Don't handle RequestRedirect raised when adding slash.
assert c.get("/slash", follow_redirects=True).data == b"slash"