Move the logout logic to the auth manager
#
#
from __future__ import annotations
from unittest import mock
from unittest.mock import Mock
import pytest
from airflow import AirflowException
from airflow.auth.managers.fab.fab_auth_manager import FabAuthManager
from airflow.auth.managers.fab.models import User
from airflow.auth.managers.fab.security_manager_override import FabAirflowSecurityManagerOverride
from airflow.www.security import ApplessAirflowSecurityManager
@pytest.fixture
def auth_manager():
    auth_manager = FabAuthManager()
    auth_manager.security_manager = ApplessAirflowSecurityManager()
    return auth_manager
class TestFabAuthManager:
    @pytest.mark.parametrize(
        "first_name,last_name,expected",
        [
            ("First", "Last", "First Last"),
            ("First", None, "First"),
            (None, "Last", "Last"),
        ],
    )
    @mock.patch.object(FabAuthManager, "get_user")
    def test_get_user_name(self, mock_get_user, first_name, last_name, expected, auth_manager):