mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 21:59:16 +02:00
Test bot can now unfollow
This commit is contained in:
parent
81e7f03f77
commit
3ad1fe17d5
6 changed files with 100 additions and 13 deletions
|
@ -3,6 +3,7 @@ import requests
|
|||
import requests_http_signature
|
||||
|
||||
from django.utils import timezone
|
||||
from django.conf import settings
|
||||
|
||||
from funkwhale_api.factories import registry
|
||||
|
||||
|
@ -65,6 +66,12 @@ class ActorFactory(factory.DjangoModelFactory):
|
|||
class Meta:
|
||||
model = models.Actor
|
||||
|
||||
class Params:
|
||||
local = factory.Trait(
|
||||
domain=factory.LazyAttribute(
|
||||
lambda o: settings.FEDERATION_HOSTNAME)
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def _generate(cls, create, attrs):
|
||||
has_public = attrs.get('public_key') is not None
|
||||
|
@ -84,6 +91,11 @@ class FollowFactory(factory.DjangoModelFactory):
|
|||
class Meta:
|
||||
model = models.Follow
|
||||
|
||||
class Params:
|
||||
local = factory.Trait(
|
||||
actor=factory.SubFactory(ActorFactory, local=True)
|
||||
)
|
||||
|
||||
|
||||
@registry.register(name='federation.Note')
|
||||
class NoteFactory(factory.Factory):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue