Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Maxence Bothorel
funkwhale
Commits
4f7fa09a
Verified
Commit
4f7fa09a
authored
Mar 18, 2018
by
Eliot Berriot
Browse files
Playlisttrack factory
parent
d7adaf39
Changes
1
Hide whitespace changes
Inline
Side-by-side
api/funkwhale_api/playlists/factories.py
View file @
4f7fa09a
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'
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment