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 ( ...@@ -14,6 +14,7 @@ from program.models import (
License, License,
LinkType, LinkType,
MusicFocus, MusicFocus,
RadioSettings,
RRule, RRule,
Schedule, Schedule,
Show, Show,
...@@ -32,6 +33,7 @@ from program.tests.factories import ( ...@@ -32,6 +33,7 @@ from program.tests.factories import (
LinkTypeFactory, LinkTypeFactory,
MusicFocusFactory, MusicFocusFactory,
OwnerFactory, OwnerFactory,
RadioSettingsFactory,
RRuleFactory, RRuleFactory,
ScheduleFactory, ScheduleFactory,
ShowFactory, ShowFactory,
...@@ -154,11 +156,28 @@ def once_rrule() -> RRule: ...@@ -154,11 +156,28 @@ def once_rrule() -> RRule:
return RRuleFactory(freq=0) return RRuleFactory(freq=0)
@pytest.fixture
def daily_rrule() -> RRule:
return RRuleFactory(freq=3)
@pytest.fixture @pytest.fixture
def show() -> Show: def show() -> Show:
return ShowFactory() 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 @pytest.fixture
def owned_show(common_user1, show) -> Show: def owned_show(common_user1, show) -> Show:
"""Show owned by a common user""" """Show owned by a common user"""
......
...@@ -16,6 +16,7 @@ from program.models import ( ...@@ -16,6 +16,7 @@ from program.models import (
LinkType, LinkType,
MusicFocus, MusicFocus,
Note, Note,
RadioSettings,
RRule, RRule,
Schedule, Schedule,
Show, Show,
...@@ -152,3 +153,8 @@ class TopicFactory(DjangoModelFactory): ...@@ -152,3 +153,8 @@ class TopicFactory(DjangoModelFactory):
class OwnerFactory(DjangoModelFactory): class OwnerFactory(DjangoModelFactory):
class Meta: class Meta:
model = User 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