Test bot can now unfollow

This commit is contained in:
Eliot Berriot 2018-04-03 23:25:44 +02:00
parent 81e7f03f77
commit 3ad1fe17d5
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
6 changed files with 100 additions and 13 deletions

View file

@ -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):