()
| 1487 | |
| 1488 | |
| 1489 | def test_static_route_with_host_matching(): |
| 1490 | app = flask.Flask(__name__, host_matching=True, static_host="example.com") |
| 1491 | c = app.test_client() |
| 1492 | rv = c.get("http://example.com/static/index.html") |
| 1493 | assert rv.status_code == 200 |
| 1494 | rv.close() |
| 1495 | with app.test_request_context(): |
| 1496 | rv = flask.url_for("static", filename="index.html", _external=True) |
| 1497 | assert rv == "http://example.com/static/index.html" |
| 1498 | # Providing static_host without host_matching=True should error. |
| 1499 | with pytest.raises(AssertionError): |
| 1500 | flask.Flask(__name__, static_host="example.com") |
| 1501 | # Providing host_matching=True with static_folder |
| 1502 | # but without static_host should error. |
| 1503 | with pytest.raises(AssertionError): |
| 1504 | flask.Flask(__name__, host_matching=True) |
| 1505 | # Providing host_matching=True without static_host |
| 1506 | # but with static_folder=None should not error. |
| 1507 | flask.Flask(__name__, host_matching=True, static_folder=None) |
| 1508 | |
| 1509 | |
| 1510 | def test_request_locals(): |
nothing calls this directly
no test coverage detected