refactor: split LDAP auth into backend/routers/auth.py
This commit is contained in:
@@ -14,6 +14,7 @@ from backend.models import User
|
||||
from backend.config_manager import ConfigManager
|
||||
from backend.auth import get_current_admin, TokenData
|
||||
import backend.routers.users as users_router
|
||||
import backend.routers.auth as auth_router
|
||||
import backend.routers.categories as categories_router
|
||||
|
||||
|
||||
@@ -84,8 +85,8 @@ def test_client(test_db: Session) -> Generator[TestClient, None, None]:
|
||||
@pytest.fixture(scope="function")
|
||||
def mock_ldap() -> Generator[MagicMock, None, None]:
|
||||
"""Mock LDAP authentication."""
|
||||
with patch("backend.routers.users.ldap3.Server") as mock_server, \
|
||||
patch("backend.routers.users.ldap3.Connection") as mock_conn_class:
|
||||
with patch("backend.routers.auth.ldap3.Server") as mock_server, \
|
||||
patch("backend.routers.auth.ldap3.Connection") as mock_conn_class:
|
||||
|
||||
mock_conn = MagicMock()
|
||||
mock_conn.bind.return_value = True
|
||||
|
||||
Reference in New Issue
Block a user