add no_auto_head option in app route decorator
This commit is contained in:
parent
660994efc7
commit
7a4c9772be
2 changed files with 22 additions and 0 deletions
|
|
@ -2024,3 +2024,16 @@ def test_app_freed_on_zero_refcount():
|
|||
assert weak() is None
|
||||
finally:
|
||||
gc.enable()
|
||||
|
||||
|
||||
def test_no_auto_head_option(app, client):
|
||||
@app.route("/", methods=["GET"], no_auto_head=True)
|
||||
def index():
|
||||
return "Hello world", 200
|
||||
|
||||
@app.route("/", methods=["HEAD"])
|
||||
def index_head():
|
||||
return "", 200, {"test-header": "test-value"}
|
||||
|
||||
assert client.get("/").data == b"Hello world"
|
||||
assert "test-header" in client.head("/").headers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue