sjyangkevin commented on code in PR #77138:
URL: https://github.com/apache/airflow/pull/77138#discussion_r4648114672


##########
providers/fab/tests/unit/fab/auth_manager/security_manager/test_override.py:
##########
@@ -423,6 +427,26 @@ def test_load_user_jwt(self, mock_g):
         assert actual_user is mock_user
         assert mock_g.user is mock_user
 
+    @pytest.mark.parametrize(
+        ("user_token_generation", "loaded"),
+        [
+            pytest.param(0, True, id="before-any-password-change"),
+            pytest.param(1, False, id="after-a-password-change"),
+        ],
+    )
+    def test_load_session_user_counts_session_without_token_generation_as_zero(
+        self, user_token_generation, loaded
+    ):
+        """A Flask session without the key was created before it existed."""
+        sm = EmptySecurityManager()
+        user = Mock(spec=User, token_generation=user_token_generation)
+        app = Flask(__name__)
+        app.secret_key = "test-secret-key"
+
+        with app.test_request_context(), mock.patch.object(sm, "load_user", 
return_value=user):

Review Comment:
   thanks , updated the mock.patch.object to decorator.



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