Skip to content

Commit

Permalink
Fix forgotten refactors v2
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackYps committed Jun 4, 2024
1 parent 12d5902 commit 82c3eef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion service/league_service/league_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ async def _persist_score(
)
result = await conn.execute(select_season_id)
row = result.fetchone()
season_id_of_division = row.get("league_season_id")
season_id_of_division = row.league_season_id
if season_id != season_id_of_division:
raise InvalidScoreError("Division id did not match season id.")

Expand Down
8 changes: 4 additions & 4 deletions tests/unit_tests/test_season_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@ async def test_generate_season(season_generator, database):
assert max(row.season_number for row in rows) == 4

divisions = await conn.execute(select(league_season_division))
rows = await divisions.fetchall()
rows = divisions.fetchall()
assert len(rows) == 9
new_division_one = await conn.execute(select(league_season_division).where(league_season_division.c.id == 8))
row = await new_division_one.fetchone()
row = new_division_one.fetchone()
assert row.league_season_id == 6
assert row.division_index == 1
assert row.name_key == "L3D1"
assert row.description_key == "second_test_league.season.1_2.division.1"

subdivisions = await conn.execute(select(league_season_division_subdivision))
rows = await subdivisions.fetchall()
rows = subdivisions.fetchall()
assert len(rows) == 10
new_subdivision = await conn.execute(
select(league_season_division_subdivision)
.where(league_season_division_subdivision.c.league_season_division_id == 8)
)
row = await new_subdivision.fetchone()
row = new_subdivision.fetchone()
assert row.subdivision_index == 1
assert row.name_key == "L3D1S1"
assert row.description_key == "second_test_league.season.1_2.subdivision.1.1"
Expand Down

0 comments on commit 82c3eef

Please sign in to comment.