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

test: add factory and fixture for Playlist

parent 58945d32
No related branches found
No related tags found
1 merge request!59Add playlists
...@@ -14,6 +14,7 @@ from program.models import ( ...@@ -14,6 +14,7 @@ from program.models import (
License, License,
LinkType, LinkType,
MusicFocus, MusicFocus,
Playlist,
Profile, Profile,
RadioSettings, RadioSettings,
RRule, RRule,
...@@ -34,6 +35,7 @@ from program.tests.factories import ( ...@@ -34,6 +35,7 @@ from program.tests.factories import (
LinkTypeFactory, LinkTypeFactory,
MusicFocusFactory, MusicFocusFactory,
OwnerFactory, OwnerFactory,
PlaylistFactory,
ProfileFactory, ProfileFactory,
RadioSettingsFactory, RadioSettingsFactory,
RRuleFactory, RRuleFactory,
...@@ -301,3 +303,8 @@ def topic() -> Topic: ...@@ -301,3 +303,8 @@ def topic() -> Topic:
@pytest.fixture @pytest.fixture
def owner() -> User: def owner() -> User:
return OwnerFactory() return OwnerFactory()
@pytest.fixture
def default_playlist(show) -> Playlist:
return PlaylistFactory(description="default playlist", show=show)
...@@ -16,6 +16,7 @@ from program.models import ( ...@@ -16,6 +16,7 @@ from program.models import (
LinkType, LinkType,
MusicFocus, MusicFocus,
Note, Note,
Playlist,
Profile, Profile,
RadioSettings, RadioSettings,
RRule, RRule,
...@@ -167,3 +168,8 @@ class CBAFactory(DjangoModelFactory): ...@@ -167,3 +168,8 @@ class CBAFactory(DjangoModelFactory):
username = Sequence(lambda n: "username_%d" % n) username = Sequence(lambda n: "username_%d" % n)
user_token = Sequence(lambda n: "user_token_%d" % n) user_token = Sequence(lambda n: "user_token_%d" % n)
class PlaylistFactory(DjangoModelFactory):
class Meta:
model = Playlist
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