diff --git a/routes/settings.py b/routes/settings.py index 077ba13..0cc2397 100644 --- a/routes/settings.py +++ b/routes/settings.py @@ -75,7 +75,7 @@ def update_css_settings(payload: CSSSettingsPayload, db: Session = Depends(get_d ] except ValueError as exc: raise HTTPException( - status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + status_code=status.HTTP_422_UNPROCESSABLE_CONTENT, detail=str(exc), ) from exc return CSSSettingsResponse( diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index 39e80c4..0ecb00e 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -68,10 +68,13 @@ def setup_database() -> Generator[None, None, None]: @pytest.fixture() def db_session() -> Generator[Session, None, None]: + Base.metadata.drop_all(bind=engine) + Base.metadata.create_all(bind=engine) session = TestingSessionLocal() try: yield session finally: + session.rollback() session.close()