forked from rc/aircox
Feat: packaging (#127)
- Add configuration files for packaging - Precommit now uses ruff Co-authored-by: bkfox <thomas bkfox net> Reviewed-on: rc/aircox#127
This commit is contained in:
@ -12,44 +12,28 @@ class TestRerunQuerySet:
|
||||
@pytest.mark.django_db
|
||||
def test_station_by_obj(self, stations, schedules):
|
||||
for station in stations:
|
||||
queryset = (
|
||||
Schedule.objects.station(station)
|
||||
.distinct()
|
||||
.values_list("program__station", flat=True)
|
||||
)
|
||||
queryset = Schedule.objects.station(station).distinct().values_list("program__station", flat=True)
|
||||
assert queryset.count() == 1
|
||||
assert queryset.first() == station.pk
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_station_by_id(self, stations, schedules):
|
||||
for station in stations:
|
||||
queryset = (
|
||||
Schedule.objects.station(id=station.pk)
|
||||
.distinct()
|
||||
.values_list("program__station", flat=True)
|
||||
)
|
||||
queryset = Schedule.objects.station(id=station.pk).distinct().values_list("program__station", flat=True)
|
||||
assert queryset.count() == 1
|
||||
assert queryset.first() == station.pk
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_program_by_obj(self, programs, schedules):
|
||||
for program in programs:
|
||||
queryset = (
|
||||
Schedule.objects.program(program)
|
||||
.distinct()
|
||||
.values_list("program", flat=True)
|
||||
)
|
||||
queryset = Schedule.objects.program(program).distinct().values_list("program", flat=True)
|
||||
assert queryset.count() == 1
|
||||
assert queryset.first() == program.pk
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_program_by_id(self, programs, schedules):
|
||||
for program in programs:
|
||||
queryset = (
|
||||
Schedule.objects.program(id=program.pk)
|
||||
.distinct()
|
||||
.values_list("program", flat=True)
|
||||
)
|
||||
queryset = Schedule.objects.program(id=program.pk).distinct().values_list("program", flat=True)
|
||||
assert queryset.count() == 1
|
||||
assert queryset.first() == program.pk
|
||||
|
||||
@ -60,11 +44,7 @@ class TestRerunQuerySet:
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_initial(self, schedules):
|
||||
queryset = (
|
||||
Schedule.objects.initial()
|
||||
.distinct()
|
||||
.values_list("initial", flat=True)
|
||||
)
|
||||
queryset = Schedule.objects.initial().distinct().values_list("initial", flat=True)
|
||||
assert queryset.count() == 1
|
||||
assert queryset.first() is None
|
||||
|
||||
|
Reference in New Issue
Block a user