See #170: can now subscribe/unsubscribe to channel

This commit is contained in:
Eliot Berriot 2020-01-15 14:24:22 +01:00
parent fc850e6e5d
commit 4236cc6274
No known key found for this signature in database
GPG key ID: 6B501DFD73514E14
5 changed files with 104 additions and 1 deletions

View file

@ -33,3 +33,14 @@ class ChannelFactory(NoUpdateOnCreate, factory.django.DjangoModelFactory):
),
artist__local=True,
)
@registry.register(name="audio.Subscription")
class SubscriptionFactory(NoUpdateOnCreate, factory.django.DjangoModelFactory):
uuid = factory.Faker("uuid4")
approved = True
target = factory.LazyAttribute(lambda o: ChannelFactory().actor)
actor = factory.SubFactory(federation_factories.ActorFactory)
class Meta:
model = "federation.Follow"