2019-02-28 08:31:04 +00:00
|
|
|
import factory
|
|
|
|
|
|
|
|
from funkwhale_api.factories import registry, NoUpdateOnCreate
|
|
|
|
|
|
|
|
from funkwhale_api.federation import factories as federation_factories
|
|
|
|
|
|
|
|
|
|
|
|
@registry.register
|
|
|
|
class MutationFactory(NoUpdateOnCreate, factory.django.DjangoModelFactory):
|
|
|
|
fid = factory.Faker("federation_url")
|
|
|
|
uuid = factory.Faker("uuid4")
|
|
|
|
created_by = factory.SubFactory(federation_factories.ActorFactory)
|
|
|
|
summary = factory.Faker("paragraph")
|
|
|
|
type = "update"
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = "common.Mutation"
|
|
|
|
|
2019-11-25 08:49:06 +00:00
|
|
|
|
|
|
|
@registry.register
|
|
|
|
class AttachmentFactory(NoUpdateOnCreate, factory.django.DjangoModelFactory):
|
|
|
|
url = factory.Faker("federation_url")
|
|
|
|
uuid = factory.Faker("uuid4")
|
|
|
|
actor = factory.SubFactory(federation_factories.ActorFactory)
|
|
|
|
file = factory.django.ImageField()
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = "common.Attachment"
|