test3 de test program

This commit is contained in:
wintz 2023-05-11 17:51:48 +02:00
parent 129f6406e8
commit 343624a036

View File

@ -1,15 +1,27 @@
import pytest
import os
from aircox.conf import settings
from aircox.models import Station, Program
class TestProgramQuerySet:
@pytest.mark.django_db
def test_station(self, stations, programs):
prog = Program.objects.station(station=stations[0])
assert programs[0] in prog
assert programs[2] not in prog
programs_with_station_0 = Program.objects.station(station=stations[0])
assert programs[0] in programs_with_station_0
assert programs[2] not in programs_with_station_0
@pytest.mark.django_db
def test_active(self, programs):
active_programs = Program.objects.active()
assert active_programs[0].active == True
class TestProgram:
@pytest.mark.django_db
def test_station(self, stations):
pass
def test_path(self, program):
program_path = program.path
assert program_path == os.path.join(settings.PROGRAMS_DIR, program.slug.replace("-", "_"))