diff --git a/conftest.py b/conftest.py index addadf793d8573613ceb3a83a02aa847b0168d91..abb8904835bf643d1ab790e66b2a31aed0ebef2b 100644 --- a/conftest.py +++ b/conftest.py @@ -14,6 +14,7 @@ from program.models import ( License, LinkType, MusicFocus, + RadioSettings, RRule, Schedule, Show, @@ -32,6 +33,7 @@ from program.tests.factories import ( LinkTypeFactory, MusicFocusFactory, OwnerFactory, + RadioSettingsFactory, RRuleFactory, ScheduleFactory, ShowFactory, @@ -154,11 +156,28 @@ def once_rrule() -> RRule: return RRuleFactory(freq=0) +@pytest.fixture +def daily_rrule() -> RRule: + return RRuleFactory(freq=3) + + @pytest.fixture def show() -> Show: return ShowFactory() +@pytest.fixture +def fallback_show() -> Show: + return ShowFactory(name="Musikpool") + + +@pytest.fixture +def radio_settings(fallback_show) -> RadioSettings: + return RadioSettingsFactory( + fallback_default_pool="Musikpool", fallback_show=fallback_show, station_name="Radio AURA" + ) + + @pytest.fixture def owned_show(common_user1, show) -> Show: """Show owned by a common user""" diff --git a/program/tests/factories.py b/program/tests/factories.py index fcf52b6b5cbad578dcdeda75799a506c19082b19..ed0185766bb81dc591b83bb04f05001df6854f9b 100644 --- a/program/tests/factories.py +++ b/program/tests/factories.py @@ -16,6 +16,7 @@ from program.models import ( LinkType, MusicFocus, Note, + RadioSettings, RRule, Schedule, Show, @@ -152,3 +153,8 @@ class TopicFactory(DjangoModelFactory): class OwnerFactory(DjangoModelFactory): class Meta: model = User + + +class RadioSettingsFactory(DjangoModelFactory): + class Meta: + model = RadioSettings