Home / Function/ test_add_template_filter() — flask Function Reference

test_add_template_filter() — flask Function Reference

Architecture documentation for the test_add_template_filter() function in test_blueprints.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  e057f949_f042_2b19_7bd4_1b745515713c["test_add_template_filter()"]
  4366a441_d387_52f9_ec8d_1c41c71c00a8["test_blueprints.py"]
  e057f949_f042_2b19_7bd4_1b745515713c -->|defined in| 4366a441_d387_52f9_ec8d_1c41c71c00a8
  style e057f949_f042_2b19_7bd4_1b745515713c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_blueprints.py lines 399–409

def test_add_template_filter(app):
    bp = flask.Blueprint("bp", __name__)

    def my_reverse(s):
        return s[::-1]

    bp.add_app_template_filter(my_reverse)
    app.register_blueprint(bp, url_prefix="/py")
    assert "my_reverse" in app.jinja_env.filters.keys()
    assert app.jinja_env.filters["my_reverse"] == my_reverse
    assert app.jinja_env.filters["my_reverse"]("abcd") == "dcba"

Subdomains

Frequently Asked Questions

What does test_add_template_filter() do?
test_add_template_filter() is a function in the flask codebase, defined in tests/test_blueprints.py.
Where is test_add_template_filter() defined?
test_add_template_filter() is defined in tests/test_blueprints.py at line 399.

Analyze Your Own Codebase

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

Try Supermodel Free