Skip to content
Myr

Added testcase for modified URL encodings

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

authored by Armin Ronacher · committed by Armin Ronacher · parent 3b0eb0f · Browse files · 1 file+15 added−0 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+15 added−0 removed

  • tests:+15 added−0 removed

1 file+15 added−0 removed

modified:tests/flask_tests.py+15 added
494 unmodified lines
495 assert rv == '"<\\/script>"'496 rv = render('{{ "<\0/script>"|tojson|safe }}')497 assert rv == '"<\\u0000\\/script>"'498499 def test_modified_url_encoding(self):500 class ModifiedRequest(flask.Request):501 url_charset = 'euc-kr'502 app = flask.Flask(__name__)503 app.request_class = ModifiedRequest504 app.url_map.charset = 'euc-kr'505506 @app.route('/')507 def index():508 return flask.request.args['foo']509510 rv = app.test_client().get(u'/?foo=정상처리'.encode('euc-kr'))511 assert rv.status_code == 200512 assert rv.data == u'정상처리'.encode('utf-8')513514515class TemplatingTestCase(unittest.TestCase):516517 def test_context_processing(self):518 app = flask.Flask(__name__)
623 unmodified lines