@@ -275,51 +275,3 @@ def get_dynamic_cookie():
275275 # cookies are being used for the urls that end with "dynamic cookie"
276276 assert test_client .get ("/get" ).data == b"42"
277277 assert test_client .get ("/get_dynamic_cookie" ).data == b"616"
278-
279-
280- def test_bad_environ_raises_bad_request ():
281- app = flask .Flask (__name__ )
282-
283- from flask .testing import EnvironBuilder
284-
285- builder = EnvironBuilder (app )
286- environ = builder .get_environ ()
287-
288- # use a non-printable character in the Host - this is key to this test
289- environ ["HTTP_HOST" ] = "\x8a "
290-
291- with app .request_context (environ ):
292- response = app .full_dispatch_request ()
293- assert response .status_code == 400
294-
295-
296- def test_environ_for_valid_idna_completes ():
297- app = flask .Flask (__name__ )
298-
299- @app .route ("/" )
300- def index ():
301- return "Hello World!"
302-
303- from flask .testing import EnvironBuilder
304-
305- builder = EnvironBuilder (app )
306- environ = builder .get_environ ()
307-
308- # these characters are all IDNA-compatible
309- environ ["HTTP_HOST" ] = "ąśźäüжŠßя.com"
310-
311- with app .request_context (environ ):
312- response = app .full_dispatch_request ()
313-
314- assert response .status_code == 200
315-
316-
317- def test_normal_environ_completes ():
318- app = flask .Flask (__name__ )
319-
320- @app .route ("/" )
321- def index ():
322- return "Hello World!"
323-
324- response = app .test_client ().get ("/" , headers = {"host" : "xn--on-0ia.com" })
325- assert response .status_code == 200
0 commit comments