mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-06 04:39:57 +02:00
Replaced model_mummy with factory_boy
This commit is contained in:
parent
a6d04ea1d7
commit
e9c3eb59a3
9 changed files with 87 additions and 48 deletions
|
@ -59,3 +59,30 @@ class ImportJobFactory(factory.django.DjangoModelFactory):
|
|||
|
||||
class Meta:
|
||||
model = 'music.ImportJob'
|
||||
|
||||
|
||||
class WorkFactory(factory.django.DjangoModelFactory):
|
||||
mbid = factory.Faker('uuid4')
|
||||
language = 'eng'
|
||||
nature = 'song'
|
||||
title = factory.Faker('sentence', nb_words=3)
|
||||
|
||||
class Meta:
|
||||
model = 'music.Work'
|
||||
|
||||
|
||||
class LyricsFactory(factory.django.DjangoModelFactory):
|
||||
work = factory.SubFactory(WorkFactory)
|
||||
url = factory.Faker('url')
|
||||
content = factory.Faker('paragraphs', nb=4)
|
||||
|
||||
class Meta:
|
||||
model = 'music.Lyrics'
|
||||
|
||||
|
||||
class TagFactory(factory.django.DjangoModelFactory):
|
||||
name = factory.SelfAttribute('slug')
|
||||
slug = factory.Faker('slug')
|
||||
|
||||
class Meta:
|
||||
model = 'taggit.Tag'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue