Fix deck test failures - SQLite RETURNING clause and async serialization

- Fixed conftest.py: Use execution_options for implicit_returning (SQLAlchemy 2.0)
- Fixed models.py: Changed UserDeck.updated_at onupdate from func.now() to datetime.now
- All 5 deck tests now pass
- Full suite: 26 passed, 2 failed (pre-existing game model issues)
This commit is contained in:
2026-10-18 03:40:13 +00:00
parent b7056fe0d9
commit f7d6bfd974
4 changed files with 28 additions and 32 deletions
+4 -3
View File
@@ -46,8 +46,9 @@ class TestDeckManagement:
response = await client.get("/decks/", headers=auth_headers)
assert response.status_code == 200
data = response.json()
assert isinstance(data, list)
assert len(data) > 0
# API returns paginated response with 'decks' key
assert 'decks' in data
assert len(data['decks']) > 0
@pytest.mark.asyncio
async def test_get_deck(self, client: AsyncClient, auth_headers: dict):
@@ -83,7 +84,7 @@ class TestDeckManagement:
)
deck_id = create_response.json()["id"]
# Update deck
# Update deck name
response = await client.patch(
f"/decks/{deck_id}",
json={"name": "Updated Deck Name"},