sync
parent
1b5182b41a
commit
b5da5736e9
|
@ -2,7 +2,7 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
|
|||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
DB_HOST: str = "localhost"
|
||||
DB_HOST: str = "db"
|
||||
DB_PORT: int = 5432
|
||||
POSTGRES_DB: str = "fastfod_db"
|
||||
POSTGRES_PASSWORD: str = "postgres"
|
||||
|
|
|
@ -26,7 +26,7 @@ class SubMenuCrud:
|
|||
session.add(new_submenu)
|
||||
await session.flush()
|
||||
await session.commit()
|
||||
return new_submenu
|
||||
return new_submenu
|
||||
|
||||
@staticmethod
|
||||
async def get_submenu_item(
|
||||
|
|
|
@ -25,7 +25,10 @@ async_session_maker = async_sessionmaker(
|
|||
|
||||
@pytest.fixture(scope="session")
|
||||
def event_loop():
|
||||
loop = asyncio.get_event_loop_policy().new_event_loop()
|
||||
try:
|
||||
loop = asyncio.get_event_loop()
|
||||
except RuntimeError:
|
||||
loop = asyncio.new_event_loop()
|
||||
yield loop
|
||||
loop.close()
|
||||
|
||||
|
|
|
@ -53,4 +53,3 @@ async def test_submenu(asession: AsyncSession) -> None:
|
|||
submenu = await SubMenuCrud.create_submenu_item(
|
||||
menu_id, menubaseschema.model_validate(submenu), asession,
|
||||
)
|
||||
print(submenu)
|
||||
|
|
Loading…
Reference in New Issue