This commit is contained in:
@@ -1,18 +1,24 @@
|
||||
import pytest
|
||||
import asyncio
|
||||
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from httpx import AsyncClient
|
||||
from shared.database import Base
|
||||
from shared.config import settings
|
||||
|
||||
from services.user_service.main import app
|
||||
from shared.config import settings
|
||||
from shared.database import Base
|
||||
|
||||
# Test database URL
|
||||
TEST_DATABASE_URL = "postgresql+asyncpg://admin:password@localhost:5432/women_safety_test"
|
||||
TEST_DATABASE_URL = (
|
||||
"postgresql+asyncpg://admin:password@localhost:5432/women_safety_test"
|
||||
)
|
||||
|
||||
# Test engine
|
||||
test_engine = create_async_engine(TEST_DATABASE_URL, echo=True)
|
||||
TestAsyncSession = sessionmaker(test_engine, class_=AsyncSession, expire_on_commit=False)
|
||||
TestAsyncSession = sessionmaker(
|
||||
test_engine, class_=AsyncSession, expire_on_commit=False
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@@ -56,5 +62,5 @@ def user_data():
|
||||
"password": "testpassword123",
|
||||
"first_name": "Test",
|
||||
"last_name": "User",
|
||||
"phone": "+1234567890"
|
||||
}
|
||||
"phone": "+1234567890",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user