MCPcopy Create free account
hub / github.com/pallets/flask / test_escaping

Function test_escaping

tests/test_templating.py:71–88  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

69
70
71def test_escaping(app, client):
72 text = "<p>Hello World!"
73
74 @app.route("/")
75 def index():
76 return flask.render_template(
77 "escaping_template.html", text=text, html=Markup(text)
78 )
79
80 lines = client.get("/").data.splitlines()
81 assert lines == [
82 b"&lt;p&gt;Hello World!",
83 b"<p>Hello World!",
84 b"<p>Hello World!",
85 b"<p>Hello World!",
86 b"&lt;p&gt;Hello World!",
87 b"<p>Hello World!",
88 ]
89
90
91def test_no_escaping(app, client):

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected