From 8aaf3025864acbb803b652495d282bc5aa7a8128 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 30 May 2013 14:35:23 +0100 Subject: [PATCH] Disable direct passthrough for accessing the data attribute on newer Werkzeugs --- flask/testsuite/helpers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flask/testsuite/helpers.py b/flask/testsuite/helpers.py index b74ad6bb..20c15262 100644 --- a/flask/testsuite/helpers.py +++ b/flask/testsuite/helpers.py @@ -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')