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

test: add factory for Radio Settings and fixtures

parent 451079fd
No related branches found
No related tags found
No related merge requests found
......@@ -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"""
......
......@@ -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
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