- Reformatted function signatures in `organization_service.py` and `task_service.py` for better alignment. - Updated import statements across multiple files for consistency and organization. - Enhanced test files by improving formatting and ensuring consistent use of async session factories. - Added type hints and improved type safety in various service and test files. - Adjusted `pyproject.toml` to include configuration for isort, mypy, and ruff for better code quality checks. - Cleaned up unused imports and organized existing ones in several test files.
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
"""Shared helpers for task and activity API tests."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from datetime import timedelta
|
||||
|
||||
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker
|
||||
|
||||
from app.core.security import jwt_service
|
||||
from app.models.contact import Contact
|
||||
from app.models.deal import Deal
|
||||
from app.models.organization import Organization
|
||||
from app.models.organization_member import OrganizationMember, OrganizationRole
|
||||
from app.models.user import User
|
||||
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
@@ -27,7 +27,9 @@ class Scenario:
|
||||
|
||||
async def prepare_scenario(session_factory: async_sessionmaker[AsyncSession]) -> Scenario:
|
||||
async with session_factory() as session:
|
||||
user = User(email="owner@example.com", hashed_password="hashed", name="Owner", is_active=True)
|
||||
user = User(
|
||||
email="owner@example.com", hashed_password="hashed", name="Owner", is_active=True
|
||||
)
|
||||
org = Organization(name="Acme LLC")
|
||||
session.add_all([user, org])
|
||||
await session.flush()
|
||||
|
||||
Reference in New Issue
Block a user