"""Tests for the ECP middleware."""

from __future__ import annotations

from typing import Any

import pytest
from django.test import Client, RequestFactory

from ecp_auth.middleware import ECPSessionMiddleware
from ecp_auth.utils import store_in_session


@pytest.mark.django_db
class TestECPSessionMiddleware:
    """Tests for the ECPSessionMiddleware."""

    def test_middleware_attaches_ecp_info(self) -> None:
        """Test that middleware adds ecp attributes to request."""
        client = Client()
        response = client.get("/auth/login/")

        # Request should have been processed by middleware
        assert response.status_code == 200

    def test_middleware_processes_response(self) -> None:
        """Test that middleware processes response without errors."""
        client = Client()
        response = client.get("/auth/login/")

        assert response.status_code == 200
