Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to Response.autocorrect_location_header in Werkzeug 2.1.0 causing test failure. #426

Open
stacywsmith opened this issue Apr 2, 2022 · 0 comments · May be fixed by #427
Open

Change to Response.autocorrect_location_header in Werkzeug 2.1.0 causing test failure. #426

stacywsmith opened this issue Apr 2, 2022 · 0 comments · May be fixed by #427
Labels
bug Something isn't working

Comments

@stacywsmith
Copy link
Contributor

stacywsmith commented Apr 2, 2022

pallets/werkzeug#2352 changed the default value of Response.autocorrect_location_header from True to False in Werkzeug >= 2.1.0.

tests/legacy/test_api_legacy.py::APITest::test_redirect currently depends upon Response.autocorrect_location_header being True.

Repro Steps (if applicable)

  1. With Werkzeug >= 2.1.0 installed
  2. inv test

Expected Behavior

Tests should pass.

Actual Behavior

tests/legacy/test_api_legacy.py::APITest::test_redirect fails with:

========================================================= short test summary info ==========================================================
FAILED tests/legacy/test_api_legacy.py::APITest::test_redirect - AssertionError: assert '/' == 'http://localhost/'

Environment

  • Python version: CPython 3.8.12
  • Flask version: 2.1.0
  • Flask-RESTX version: 0.5.1
  • Other installed Flask extensions: N/A
  • Werkzeaug: 2.1.0
@stacywsmith stacywsmith added the bug Something isn't working label Apr 2, 2022
stacywsmith added a commit to stacywsmith/flask-restx that referenced this issue Apr 2, 2022
Fixes python-restx#426

pallets/werkzeug#2352 changed the default value of Response.autocorrect_location_header from True to False in Werkzeug >= 2.1.0.

tests/legacy/test_api_legacy.py::APITest::test_redirect depended upon Response.autocorrect_location_header being True.

Change `test_redirect()` to explicitly set `Response.autocorrect_location_header` to `False`, for backwards compatibility, and change the expected result for the test from an absolute URL to the relative URL.
cedricbonhomme added a commit to monarc-project/stats-service that referenced this issue May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant