Skip to content
Myr

remove werkzeug host tests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent b21425d · Browse files · 1 file+0 added−48 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+0 added−48 removed

  • tests:+0 added−48 removed

1 file+0 added−48 removed

modified:tests/test_reqctx.py-48 removed
273 unmodified lines
274 # now check that the relevant values come back - meaning that different275 # cookies are being used for the urls that end with "dynamic cookie"276 assert test_client.get("/get").data == b"42"277 assert test_client.get("/get_dynamic_cookie").data == b"616"278279280def test_bad_environ_raises_bad_request():281 app = flask.Flask(__name__)282283 from flask.testing import EnvironBuilder284285 builder = EnvironBuilder(app)286 environ = builder.get_environ()287288 # use a non-printable character in the Host - this is key to this test289 environ["HTTP_HOST"] = "\x8a"290291 with app.request_context(environ):292 response = app.full_dispatch_request()293 assert response.status_code == 400294295296def test_environ_for_valid_idna_completes():297 app = flask.Flask(__name__)298299 @app.route("/")300 def index():301 return "Hello World!"302303 from flask.testing import EnvironBuilder304305 builder = EnvironBuilder(app)306 environ = builder.get_environ()307308 # these characters are all IDNA-compatible309 environ["HTTP_HOST"] = "ąśźäüжŠßя.com"310311 with app.request_context(environ):312 response = app.full_dispatch_request()313314 assert response.status_code == 200315316317def test_normal_environ_completes():318 app = flask.Flask(__name__)319320 @app.route("/")321 def index():322 return "Hello World!"323324 response = app.test_client().get("/", headers={"host": "xn--on-0ia.com"})325 assert response.status_code == 200