From 2a9715d0efaa7eb26a70d4425beb31e82c6fd4ec Mon Sep 17 00:00:00 2001 From: Dries Peeters Date: Thu, 13 Nov 2025 14:28:30 +0100 Subject: [PATCH] Update conftest.py --- tests/conftest.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 34b6a07..f321a51 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -288,12 +288,10 @@ def project(app, test_client): ) project.status = 'active' # Set after creation db.session.add(project) - # Flush to assign ID before commit, then re-query after commit + # Flush to assign ID before commit and return the same instance to avoid re-query issues db.session.flush() - project_id = project.id db.session.commit() - persisted_project = Project.query.get(project_id) or Project.query.filter_by(id=project_id).first() - return persisted_project + return project @pytest.fixture