diff --git a/CHANGES.rst b/CHANGES.rst index f4e0b5d0..03374344 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,5 +1,14 @@ .. currentmodule:: flask + +Version 2.1.1 +------------- + +Unreleased + +- Add specified HTTP method validation. + + Version 2.1.0 ------------- diff --git a/tests/test_basic.py b/tests/test_basic.py index 2cb96794..eb62a491 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -2026,3 +2026,11 @@ def test_app_freed_on_zero_refcount(): assert weak() is None finally: gc.enable() + + +def test_validate_http_method_route(app, client): + + with pytest.raises(TypeError): + @app.route("/", methods=["BAD_METHOD"]) + def bad_method_func(): + return "Hello World" \ No newline at end of file