Move the logout logic to the auth manager
old_session_cookie = get_session_cookie(user_client)
    assert old_session_cookie is not None
    resp = user_client.get("/logout/")
    assert resp.status_code == 302
    patch_path = "airflow.www.fab_security.manager.check_password_hash"
    with mock.patch(patch_path) as check_password_hash:
        check_password_hash.return_value = True
        resp = user_client.post("/login/", data={"username": "test_user", "password": "test_user"})
    assert resp.status_code == 302
    new_session_cookie = get_session_cookie(user_client)
    assert new_session_cookie is not None
    assert old_session_cookie.value != new_session_cookie.value
def test_check_active_user(app, user_client):
    user = app.appbuilder.sm.find_user(username="test_user")
    user.active = False
    resp = user_client.get("/home")
    assert resp.status_code == 302
    assert "/login" in resp.headers.get("Location")
    
    user.active = True
    resp = user_client.get("/home")
    assert resp.status_code == 302
    assert "/login" in resp.headers.get("Location")