mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 08:19:24 +02:00
Audio federation
This commit is contained in:
parent
6992c567fb
commit
e49a460203
85 changed files with 2598 additions and 1204 deletions
|
@ -6,7 +6,9 @@ import PIL
|
|||
import random
|
||||
import shutil
|
||||
import tempfile
|
||||
import uuid
|
||||
|
||||
from faker.providers import internet as internet_provider
|
||||
import factory
|
||||
import pytest
|
||||
import requests_mock
|
||||
|
@ -24,6 +26,25 @@ from funkwhale_api.activity import record
|
|||
from funkwhale_api.users.permissions import HasUserPermission
|
||||
|
||||
|
||||
class FunkwhaleProvider(internet_provider.Provider):
|
||||
"""
|
||||
Our own faker data generator, since built-in ones are sometimes
|
||||
not random enough
|
||||
"""
|
||||
|
||||
def federation_url(self, prefix=""):
|
||||
def path_generator():
|
||||
return "{}/{}".format(prefix, uuid.uuid4())
|
||||
|
||||
domain = self.domain_name()
|
||||
protocol = "https"
|
||||
path = path_generator()
|
||||
return "{}://{}/{}".format(protocol, domain, path)
|
||||
|
||||
|
||||
factory.Faker.add_provider(FunkwhaleProvider)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def queryset_equal_queries():
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue