Fixed all tests

This commit is contained in:
2026-02-22 20:34:33 +01:00 Verified
parent 1469b87ddb
commit 141ddb0c08
4 changed files with 18 additions and 29 deletions
+9 -5
View File
@@ -23,7 +23,9 @@ async def test_scoring_flow(
# Find the first playable match (Round 1)
# We look for a match that has teams assigned but is not finished
active_match = next(
m for m in matches if m["status"] == "Pending" and m["p1_team"] and m["p2_team"]
m
for m in matches
if m["status"] == "Pending" and m["p1_team_id"] and m["p2_team_id"]
)
match_id = active_match["id"]
@@ -47,11 +49,11 @@ async def test_scoring_flow(
target_match = next(m for m in updated_matches if m["id"] == next_match_id)
winner_id = active_match["p1_team"]["id"]
winner_id = active_match["p1_team_id"]
# Check if winner is now in the next match
p1_in_target = target_match["p1_team"]["id"] if target_match["p1_team"] else None
p2_in_target = target_match["p2_team"]["id"] if target_match["p2_team"] else None
p1_in_target = target_match["p1_team_id"]
p2_in_target = target_match["p2_team_id"]
assert winner_id in [p1_in_target, p2_in_target]
@@ -73,7 +75,9 @@ async def test_clear_score(client: AsyncClient, auth_headers, valid_tournament_p
# Get active match
detail = (await client.get(f"/tournaments/{t_id}")).json()
active_match = next(m for m in detail["matches"] if m["p1_team"] and m["p2_team"])
active_match = next(
m for m in detail["matches"] if m["p1_team_id"] and m["p2_team_id"]
)
match_id = active_match["id"]
score_payload = {"id": match_id, "code": "1234", "sets": [{"p1": 25, "p2": 0}]}