mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 05:39:16 +02:00
Added follow model and factory
This commit is contained in:
parent
6aa6f1d8f8
commit
f19418d2c2
7 changed files with 99 additions and 2 deletions
|
@ -53,7 +53,6 @@ class SignedRequestFactory(factory.Factory):
|
|||
|
||||
@registry.register
|
||||
class ActorFactory(factory.DjangoModelFactory):
|
||||
|
||||
public_key = None
|
||||
private_key = None
|
||||
preferred_username = factory.Faker('user_name')
|
||||
|
@ -77,6 +76,15 @@ class ActorFactory(factory.DjangoModelFactory):
|
|||
return super()._generate(create, attrs)
|
||||
|
||||
|
||||
@registry.register
|
||||
class FollowFactory(factory.DjangoModelFactory):
|
||||
target = factory.SubFactory(ActorFactory)
|
||||
actor = factory.SubFactory(ActorFactory)
|
||||
|
||||
class Meta:
|
||||
model = models.Follow
|
||||
|
||||
|
||||
@registry.register(name='federation.Note')
|
||||
class NoteFactory(factory.Factory):
|
||||
type = 'Note'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue