Merge pull request 'fix: add missing week field to scout reward POST' (#75) from fix/scout-reward-week into main
All checks were successful
Build Docker Image / build (push) Successful in 59s

Reviewed-on: #75
This commit is contained in:
cal 2026-03-09 15:22:22 +00:00
commit 9d9b30e2fc
2 changed files with 5 additions and 1 deletions

View File

@ -11,7 +11,7 @@ import logging
import discord
from api_calls import db_post
from api_calls import db_get, db_post
from helpers.main import get_team_by_owner, get_card_embeds
from helpers.scouting import (
SCOUT_TOKENS_PER_DAY,
@ -207,12 +207,14 @@ class ScoutButton(discord.ui.Button):
)
# Consume a scout token
current = await db_get("current")
await db_post(
"rewards",
payload={
"name": "Scout Token",
"team_id": scouter_team["id"],
"season": PD_SEASON,
"week": current["week"],
"created": int_timestamp(),
},
)

View File

@ -210,12 +210,14 @@ class TestScoutButtonSuccess:
@pytest.mark.asyncio
@patch("discord_ui.scout_view.get_card_embeds", new_callable=AsyncMock)
@patch("discord_ui.scout_view.db_post", new_callable=AsyncMock)
@patch("discord_ui.scout_view.db_get", new_callable=AsyncMock)
@patch("discord_ui.scout_view.get_scout_tokens_used", new_callable=AsyncMock)
@patch("discord_ui.scout_view.get_team_by_owner", new_callable=AsyncMock)
async def test_successful_scout_creates_card_copy(
self,
mock_get_team,
mock_get_tokens,
mock_db_get,
mock_db_post,
mock_card_embeds,
sample_cards,