(client)
| 322 | |
| 323 | |
| 324 | def test_custom_template_loader(client): |
| 325 | class MyFlask(flask.Flask): |
| 326 | def create_global_jinja_loader(self): |
| 327 | from jinja2 import DictLoader |
| 328 | |
| 329 | return DictLoader({"index.html": "Hello Custom World!"}) |
| 330 | |
| 331 | app = MyFlask(__name__) |
| 332 | |
| 333 | @app.route("/") |
| 334 | def index(): |
| 335 | return flask.render_template("index.html") |
| 336 | |
| 337 | c = app.test_client() |
| 338 | rv = c.get("/") |
| 339 | assert rv.data == b"Hello Custom World!" |
| 340 | |
| 341 | |
| 342 | def test_iterable_loader(app, client): |
nothing calls this directly
no test coverage detected