Remove CRUD test modules for unused and deprecated features

- Deleted `test_crud_base.py`, `test_crud_error_paths.py`, and `test_organization_async.py` due to the removal of corresponding deprecated CRUD implementations.
- Improved codebase maintainability and reduced test suite noise by eliminating obsolete test files.
This commit is contained in:
Felipe Cardoso
2025-11-01 05:48:20 +01:00
parent efcf10f9aa
commit a062daddc5
11 changed files with 685 additions and 2100 deletions

View File

@@ -12,7 +12,7 @@ from httpx import AsyncClient, ASGITransport
os.environ["IS_TEST"] = "True"
from app.main import app
from app.core.database_async import get_async_db
from app.core.database import get_db
from app.models.user import User
from app.core.auth import get_password_hash
from app.utils.test_utils import setup_test_db, teardown_test_db, setup_async_test_db, teardown_async_test_db
@@ -100,18 +100,18 @@ async def client(async_test_db):
"""
Create a FastAPI async test client with a test database.
This overrides the get_async_db dependency to use the test database.
This overrides the get_db dependency to use the test database.
"""
test_engine, AsyncTestingSessionLocal = async_test_db
async def override_get_async_db():
async def override_get_db():
async with AsyncTestingSessionLocal() as session:
try:
yield session
finally:
pass
app.dependency_overrides[get_async_db] = override_get_async_db
app.dependency_overrides[get_db] = override_get_db
# Use ASGITransport for httpx >= 0.27
transport = ASGITransport(app=app)