o-nikolas commented on code in PR #46381:
URL: https://github.com/apache/airflow/pull/46381#discussion_r1943468895


##########
providers/tests/amazon/aws/auth_manager/router/test_login.py:
##########
@@ -19,11 +19,16 @@
 from unittest.mock import Mock, patch
 
 import pytest
-from flask import session, url_for
 
-from airflow.exceptions import AirflowException
 from airflow.providers.amazon.version_compat import AIRFLOW_V_3_0_PLUS
-from airflow.www import app as application
+
+if not AIRFLOW_V_3_0_PLUS:
+    pytest.skip("AWS auth manager is only compatible with Airflow >= 3.0.0", 
allow_module_level=True)

Review Comment:
   Do we need to update the minimum supported airflow version for the amazon 
provider package now? Or have we already done/plan to do this?



##########
providers/tests/amazon/aws/auth_manager/router/test_login.py:
##########
@@ -126,16 +113,13 @@ def test_login_callback_set_user_in_session(self):
                     "email": ["email"],
                 }
                 mock_init_saml_auth.return_value = auth
-                app = application.create_app(testing=True)
-                with app.test_client() as client:
-                    response = client.get("/login_callback")
-                    assert response.status_code == 302
-                    assert response.location == url_for("Airflow.index")
-                    assert session["aws_user"] is not None
-                    assert session["aws_user"].get_id() == "1"
-                    assert session["aws_user"].get_name() == "user_id"
-
-    def test_login_callback_raise_exception_if_errors(self):
+                client = TestClient(create_app())
+                response = client.post("/auth/login_callback", 
follow_redirects=False)
+                assert response.status_code == 303

Review Comment:
   Mostly curious, why does the response code change from 302 to 303?



-- 
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]

Reply via email to