Commit 5648ee29 authored by Agate's avatar Agate 💬

Merge branch 'fix-factories' into 'develop'

Fix Factories for dev data

See merge request !664
parents 4a9e7fa7 1a3e7a5e
Pipeline #3542 passed with stages
in 2 minutes and 53 seconds
import uuid
import factory
import persisting_theory
from faker.providers import internet as internet_provider
class FactoriesRegistry(persisting_theory.Registry):
look_into = "factories"
......@@ -39,3 +42,22 @@ class NoUpdateOnCreate:
def _after_postgeneration(cls, instance, create, results=None):
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)
Fixed dev command for fake data creation (!664)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment