Skip to content
Snippets Groups Projects
Verified Commit ce3b4b7b authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

test: update radio settings fixture & fix tests

parent 6b54bf67
No related branches found
No related tags found
No related merge requests found
......@@ -174,7 +174,10 @@ def fallback_show() -> Show:
@pytest.fixture
def radio_settings(fallback_show) -> RadioSettings:
return RadioSettingsFactory(
fallback_default_pool="Musikpool", fallback_show=fallback_show, station_name="Radio AURA"
fallback_default_pool="fallback",
fallback_show=fallback_show,
pools={"fallback": "Station Fallback Pool"},
station_name="Radio AURA",
)
......
......@@ -44,9 +44,9 @@ def test_day_schedule(admin_api_client, api_client, once_rrule, show):
entry = response.json()[0]
assert not entry["isVirtual"]
assert entry["showId"] == show.id
assert entry["showName"] == show.name
assert not entry["timeslot"]["isVirtual"]
assert entry["show"]["id"] == show.id
assert entry["show"]["name"] == show.name
def test_day_schedule_include_virtual(
......@@ -65,11 +65,9 @@ def test_day_schedule_include_virtual(
assert len(response.json()) == 3
for entry in response.json():
if entry["isVirtual"]:
print("V")
assert entry["showId"] == fallback_show.id
assert entry["showName"] == fallback_show.name
if entry["timeslot"]["isVirtual"]:
assert entry["show"]["id"] == fallback_show.id
assert entry["show"]["name"] == fallback_show.name
else:
print("R")
assert entry["showId"] == show.id
assert entry["showName"] == show.name
assert entry["show"]["id"] == show.id
assert entry["show"]["name"] == show.name
......@@ -42,9 +42,9 @@ def test_playout(admin_api_client, api_client, daily_rrule, show):
assert len(response.json()) == 7
for entry in response.json():
assert not entry["isVirtual"]
assert entry["showId"] == show.id
assert entry["showName"] == show.name
assert not entry["timeslot"]["isVirtual"]
assert entry["show"]["id"] == show.id
assert entry["show"]["name"] == show.name
def test_playout_include_virtual(
......@@ -63,9 +63,9 @@ def test_playout_include_virtual(
assert len(response.json()) == 14 or 15
for entry in response.json():
if entry["isVirtual"]:
assert entry["showId"] == fallback_show.id
assert entry["showName"] == fallback_show.name
if entry["timeslot"]["isVirtual"]:
assert entry["show"]["id"] == fallback_show.id
assert entry["show"]["name"] == fallback_show.name
else:
assert entry["showId"] == show.id
assert entry["showName"] == show.name
assert entry["show"]["id"] == show.id
assert entry["show"]["name"] == show.name
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment