Move the logout logic to the auth manager
#
#
from __future__ import annotations
from unittest import mock
import pytest
from airflow.exceptions import AirflowConfigException
from airflow.www import app
from tests.test_utils.config import conf_vars
from tests.test_utils.decorators import dont_initialize_flask_app_submodules
def get_session_cookie(client):
    return next((cookie for cookie in client.cookie_jar if cookie.name == "session"), None)
def test_session_cookie_created_on_login(user_client):
    assert get_session_cookie(user_client) is not None
def test_session_inaccessible_after_logout(user_client):
    session_cookie = get_session_cookie(user_client)
    assert session_cookie is not None
    resp = user_client.get("/logout/")
    assert resp.status_code == 302
    
    user_client.set_cookie("session", session_cookie.value)
    user_client.get("/home/")
    assert resp.status_code == 302
def test_invalid_session_backend_option():