• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

djbrown / hbscorez / 18448143290

12 Oct 2025 06:54PM UTC coverage: 46.467%. Remained the same
18448143290

Pull #165

github

djbrown
hbnet url in settings
Pull Request #165: hbnet url in settings

49 of 224 branches covered (21.88%)

Branch coverage included in aggregate %.

2 of 12 new or added lines in 10 files covered. (16.67%)

60 existing lines in 5 files now uncovered.

1700 of 3540 relevant lines covered (48.02%)

0.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

23.08
/src/api/views.py
1
from django.http import JsonResponse
1✔
2

3
from associations.models import Association
1✔
4
from districts.models import District
1✔
5
from leagues.models import League, Season
1✔
6

7

8
def associations(_):
1✔
9
    light_associations = [
×
10
        {
11
            "bhvId": a.bhv_id,
12
            "name": a.name,
13
            "abbreviation": a.abbreviation,
14
        }
15
        for a in Association.objects.all()
16
    ]
17

UNCOV
18
    return JsonResponse({"associations": light_associations})
×
19

20

21
def association_districts(_, bhv_id):
1✔
22
    association_results = Association.objects.filter(bhv_id=bhv_id)
×
23

24
    if not association_results.exists():
×
UNCOV
25
        return JsonResponse({"error": "No matching Association found."}, status=404)
×
26

UNCOV
27
    association = association_results[0]
×
28

UNCOV
29
    districts = [
×
30
        {
31
            "bhvId": district.bhv_id,
32
            "name": district.name,
33
        }
34
        for district in association.district_set.all()
35
    ]
36

UNCOV
37
    return JsonResponse({"districts": districts})
×
38

39

40
def seasons(_):
1✔
UNCOV
41
    light_seasons = [{"startYear": season.start_year} for season in Season.objects.all()]
×
42

UNCOV
43
    return JsonResponse({"seasons": light_seasons})
×
44

45

46
def district_season_leagues(_, bhv_id, start_year):
1✔
47
    district_results = District.objects.filter(bhv_id=bhv_id)
×
48
    if not district_results.exists():
×
49
        return JsonResponse({"error": "No matching District found."}, status=404)
×
UNCOV
50
    district = district_results[0]
×
51

52
    season_results = Season.objects.filter(start_year=start_year)
×
53
    if not season_results.exists():
×
54
        return JsonResponse({"error": "No matching Season found."}, status=404)
×
UNCOV
55
    season = season_results[0]
×
56

UNCOV
57
    light_leagues = [
×
58
        {
59
            "bhvId": league.bhv_id,
60
            "name": league.name,
61
        }
62
        for league in League.objects.filter(district=district, season=season)
63
    ]
64

UNCOV
65
    return JsonResponse({"leagues": light_leagues})
×
66

67

68
def league_teams(_, bhv_id):
1✔
UNCOV
69
    leagues = League.objects.filter(bhv_id=bhv_id)
×
70

71
    if not leagues.exists():
×
UNCOV
72
        return JsonResponse({"error": "No matching League found."}, status=404)
×
73

UNCOV
74
    league = leagues[0]
×
75

UNCOV
76
    light_teams = [
×
77
        {
78
            "bhvId": team.bhv_id,
79
            "name": team.name,
80
            "shortName": team.short_name,
81
        }
82
        for team in league.team_set.all()
83
    ]
84

UNCOV
85
    return JsonResponse({"teams": light_teams})
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc