mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-21 06:09:40 +02:00
25 lines
709 B
Python
25 lines
709 B
Python
|
import random
|
||
|
import string
|
||
|
|
||
|
from mealie.schema.user.registration import CreateUserRegistration
|
||
|
|
||
|
|
||
|
def random_string(length=10) -> str:
|
||
|
return "".join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length)).strip()
|
||
|
|
||
|
|
||
|
def random_email(length=10) -> str:
|
||
|
return "".join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length)) + "@fake.com"
|
||
|
|
||
|
|
||
|
def user_registration_factory() -> CreateUserRegistration:
|
||
|
return CreateUserRegistration(
|
||
|
group=random_string(),
|
||
|
email=random_email(),
|
||
|
username=random_string(),
|
||
|
password="fake-password",
|
||
|
password_confirm="fake-password",
|
||
|
advanced=False,
|
||
|
private=False,
|
||
|
)
|