mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 00:59:17 +02:00
Less DB queries in test factories
This commit is contained in:
parent
b6902009ac
commit
d4eff5aa32
9 changed files with 61 additions and 54 deletions
|
@ -1,12 +1,12 @@
|
|||
import factory
|
||||
|
||||
from funkwhale_api.factories import registry
|
||||
from funkwhale_api.factories import registry, NoUpdateOnCreate
|
||||
from funkwhale_api.music import factories
|
||||
from funkwhale_api.users.factories import UserFactory
|
||||
|
||||
|
||||
@registry.register
|
||||
class ListeningFactory(factory.django.DjangoModelFactory):
|
||||
class ListeningFactory(NoUpdateOnCreate, factory.django.DjangoModelFactory):
|
||||
user = factory.SubFactory(UserFactory)
|
||||
track = factory.SubFactory(factories.TrackFactory)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue