add generate_template and generate_template_string functions

This commit is contained in:
pgjones 2022-06-09 09:21:48 +01:00 committed by David Lord
parent 762382e436
commit 46433e9807
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
7 changed files with 139 additions and 37 deletions

View file

@ -29,6 +29,15 @@ def test_original_win(app, client):
assert rv.data == b"42"
def test_simple_stream(app, client):
@app.route("/")
def index():
return flask.stream_template_string("{{ config }}", config=42)
rv = client.get("/")
assert rv.data == b"42"
def test_request_less_rendering(app, app_ctx):
app.config["WORLD_NAME"] = "Special World"