bugraoz93 commented on code in PR #51657:
URL: https://github.com/apache/airflow/pull/51657#discussion_r2226929538
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_auth.py:
##########
@@ -91,3 +92,38 @@ def test_should_respond_307(
assert response.status_code == 307
assert response.headers["location"] == expected_redirection
+
+
+class TestRefresh(TestAuthEndpoint):
+ @pytest.mark.parametrize(
+ "params",
+ [
+ {},
+ {"next": None},
+ {"next": "http://localhost:8080"},
+ {"next": "http://localhost:8080", "other_param": "something_else"},
+ ],
+ )
+ @patch("airflow.api_fastapi.core_api.routes.public.auth.is_safe_url",
return_value=True)
+ def test_should_respond_307(self, mock_is_safe_url, test_client, params):
+ response = test_client.get("/auth/refresh", follow_redirects=False,
params=params)
+
+ assert response.status_code == 307
+ assert (
+ response.headers["location"] ==
f"{AUTH_MANAGER_LOGIN_URL}?next={params.get('next')}"
Review Comment:
Yes, you are right. I missed that. Added and included as a test case as well
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]