diff --git a/backend/backend.log b/backend/backend.log index fca0f05d..659c1f29 100644 --- a/backend/backend.log +++ b/backend/backend.log @@ -450,3 +450,13 @@ INFO: Waiting for application startup. INFO: Application startup complete. MinIO init warning: HTTPConnectionPool(host='localhost', port=9000): Max retries exceeded with url: /pdg-files?location= (Caused by NewConnectionError("HTTPConnection(host='localhost', port=9000): Failed to establish a new connection: [Errno 61] Connection refused")) INFO: 127.0.0.1:50646 - "GET /health HTTP/1.1" 200 OK +WARNING: WatchFiles detected changes in 'tests/test_auth.py'. Reloading... +INFO: Shutting down +INFO: Waiting for application shutdown. +INFO: Application shutdown complete. +INFO: Finished server process [35542] +/Users/nathan/Work/DataPointer/prop-data-guard/backend/.venv/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020 + warnings.warn( +INFO: Started server process [35866] +INFO: Waiting for application startup. +INFO: Application startup complete. diff --git a/backend/tests/test_auth.py b/backend/tests/test_auth.py index 5327c71e..74258a4e 100644 --- a/backend/tests/test_auth.py +++ b/backend/tests/test_auth.py @@ -3,9 +3,13 @@ from fastapi.testclient import TestClient from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker +import sys +sys.path.insert(0, '/Users/nathan/Work/DataPointer/prop-data-guard/backend') + from app.main import app from app.core.database import Base, get_db -from app.core.config import settings +from app.services.user_service import create_initial_data +from app.services.classification_service import init_builtin_data # Use SQLite for testing SQLALCHEMY_DATABASE_URL = "sqlite:///./test.db" @@ -28,6 +32,10 @@ client = TestClient(app) @pytest.fixture(scope="module", autouse=True) def setup_db(): Base.metadata.create_all(bind=engine) + db = TestingSessionLocal() + create_initial_data(db) + init_builtin_data(db) + db.close() yield Base.metadata.drop_all(bind=engine)