feat: improve scouting dashboard and demo data

This commit is contained in:
bisco
2026-06-03 22:42:08 +02:00
parent 22f4a9159a
commit 7101900e19
10 changed files with 633 additions and 160 deletions
@@ -0,0 +1,33 @@
import pytest
from django.core.management import call_command
from scouting.models import League, Player, PlayerSeasonStat
@pytest.mark.django_db
def test_seed_demo_data_creates_a_useful_scouting_board():
call_command("seed_demo_data")
assert Player.objects.count() >= 24
assert PlayerSeasonStat.objects.count() >= 24
assert set(League.objects.values_list("code", flat=True)) >= {
"LBA",
"ACB",
"ABA",
"BBL",
"BSL",
"LNB",
"ISBL",
"NBL",
"NZNBL",
}
@pytest.mark.django_db
def test_seed_demo_data_is_idempotent():
call_command("seed_demo_data")
first_count = Player.objects.count()
call_command("seed_demo_data")
assert Player.objects.count() == first_count