(app: Quart, blueprint: Blueprint)
| 120 | |
| 121 | |
| 122 | async def test_template_tests(app: Quart, blueprint: Blueprint) -> None: |
| 123 | @blueprint.app_template_test() |
| 124 | def blueprint_test(value: int) -> bool: |
| 125 | return value == 5 |
| 126 | |
| 127 | @app.template_test() |
| 128 | def app_test(value: int) -> bool: |
| 129 | return value == 3 |
| 130 | |
| 131 | app.register_blueprint(blueprint) |
| 132 | |
| 133 | async with app.app_context(): |
| 134 | rendered = await render_template_string("{% if 3 is app_test %}foo{% endif %}") |
| 135 | assert rendered == "foo" |
| 136 | |
| 137 | async with app.test_request_context("/"): |
| 138 | rendered = await render_template_string( |
| 139 | "{% if 5 is blueprint_test %}bar{% endif %}" |
| 140 | ) |
| 141 | assert rendered == "bar" |
| 142 | |
| 143 | |
| 144 | async def test_simple_stream(app: Quart) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…