| 410 | called = [] |
| 411 | |
| 412 | class _TestHandler(logging.Handler): |
| 413 | def handle(self, record): |
| 414 | called.append(True) |
| 415 | text = str(record.msg) |
| 416 | assert "1: trying loader of application 'blueprintapp'" in text |
| 417 | assert ( |
| 418 | "2: trying loader of blueprint 'admin' (blueprintapp.apps.admin)" |
| 419 | ) in text |
| 420 | assert ( |
| 421 | "trying loader of blueprint 'frontend' (blueprintapp.apps.frontend)" |
| 422 | ) in text |
| 423 | assert "Error: the template could not be found" in text |
| 424 | assert ( |
| 425 | "looked up from an endpoint that belongs to the blueprint 'frontend'" |
| 426 | ) in text |
| 427 | assert "See https://flask.palletsprojects.com/blueprints/#templates" in text |
| 428 | |
| 429 | with app.test_client() as c: |
| 430 | monkeypatch.setitem(app.config, "EXPLAIN_TEMPLATE_LOADING", True) |
no outgoing calls