Add tests for svg escaping
This commit is contained in:
parent
f87623f8d7
commit
1a8ddbdac6
2 changed files with 10 additions and 0 deletions
1
tests/templates/escaping_template.svg
Normal file
1
tests/templates/escaping_template.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg height='50' width='200'><text x='0' y='25'>{{ text }}</text></svg>
|
||||||
|
After Width: | Height: | Size: 71 B |
|
|
@ -114,6 +114,15 @@ def test_escaping_without_template_filename(app, client, req_ctx):
|
||||||
assert flask.render_template("mail.txt", foo="<test>") == "<test> Mail"
|
assert flask.render_template("mail.txt", foo="<test>") == "<test> Mail"
|
||||||
|
|
||||||
|
|
||||||
|
def test_escaping_svg(app, client):
|
||||||
|
@app.route("/")
|
||||||
|
def index():
|
||||||
|
return flask.render_template("escaping_template.svg", text="<test>")
|
||||||
|
|
||||||
|
rv = client.get("/")
|
||||||
|
assert rv.data == b"<svg height='50' width='200'><text x='0' y='25'><test></text></svg>"
|
||||||
|
|
||||||
|
|
||||||
def test_macros(app, req_ctx):
|
def test_macros(app, req_ctx):
|
||||||
macro = flask.get_template_attribute("_macro.html", "hello")
|
macro = flask.get_template_attribute("_macro.html", "hello")
|
||||||
assert macro("World") == "Hello World!"
|
assert macro("World") == "Hello World!"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue