Home / Function/ test_custom_template_loader() — flask Function Reference

test_custom_template_loader() — flask Function Reference

Architecture documentation for the test_custom_template_loader() function in test_templating.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  a8cf55e4_82fc_7cdd_ba60_843337b6995e["test_custom_template_loader()"]
  b3595fee_7041_96b0_f59f_4080381c7deb["test_templating.py"]
  a8cf55e4_82fc_7cdd_ba60_843337b6995e -->|defined in| b3595fee_7041_96b0_f59f_4080381c7deb
  c3831cf4_d4fe_cd61_003e_fccb89c04351["create_global_jinja_loader()"]
  a8cf55e4_82fc_7cdd_ba60_843337b6995e -->|calls| c3831cf4_d4fe_cd61_003e_fccb89c04351
  style a8cf55e4_82fc_7cdd_ba60_843337b6995e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_templating.py lines 405–420

def test_custom_template_loader(client):
    class MyFlask(flask.Flask):
        def create_global_jinja_loader(self):
            from jinja2 import DictLoader

            return DictLoader({"index.html": "Hello Custom World!"})

    app = MyFlask(__name__)

    @app.route("/")
    def index():
        return flask.render_template("index.html")

    c = app.test_client()
    rv = c.get("/")
    assert rv.data == b"Hello Custom World!"

Subdomains

Frequently Asked Questions

What does test_custom_template_loader() do?
test_custom_template_loader() is a function in the flask codebase, defined in tests/test_templating.py.
Where is test_custom_template_loader() defined?
test_custom_template_loader() is defined in tests/test_templating.py at line 405.
What does test_custom_template_loader() call?
test_custom_template_loader() calls 1 function(s): create_global_jinja_loader.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free