mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 14:19:19 +02:00
Playlisttrack factory
This commit is contained in:
parent
d7adaf398f
commit
4f7fa09a78
1 changed files with 10 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
import factory
|
||||
|
||||
from funkwhale_api.factories import registry
|
||||
from funkwhale_api.music.factories import TrackFactory
|
||||
from funkwhale_api.users.factories import UserFactory
|
||||
|
||||
|
||||
|
@ -11,3 +12,12 @@ class PlaylistFactory(factory.django.DjangoModelFactory):
|
|||
|
||||
class Meta:
|
||||
model = 'playlists.Playlist'
|
||||
|
||||
|
||||
@registry.register
|
||||
class PlaylistTrackFactory(factory.django.DjangoModelFactory):
|
||||
playlist = factory.SubFactory(PlaylistFactory)
|
||||
track = factory.SubFactory(TrackFactory)
|
||||
|
||||
class Meta:
|
||||
model = 'playlists.PlaylistTrack'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue