mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 21:45:25 +02:00
feat(backend): ✨ migrate site-settings to groups (#673)
* feat(frontend): ✨ add user registration page (WIP) * feat(backend): ✨ add user registration (WIP) * test(backend): ✅ add validator testing for registration schema * feat(backend): ✨ continued work on user sign-up * feat(backend): ✨ add signup flow and user/group settings * test(backend): ✅ user-creation tests and small refactor of existing tests * fix(backend): ✅ fix failing group tests * style: 🎨 fix lint issues Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
parent
e179dcdb10
commit
3c504e7048
63 changed files with 1665 additions and 841 deletions
|
@ -0,0 +1,71 @@
|
|||
import pytest
|
||||
|
||||
from mealie.schema.user.registration import CreateUserRegistration
|
||||
|
||||
|
||||
def test_create_user_registration() -> None:
|
||||
CreateUserRegistration(
|
||||
group="Home",
|
||||
group_token=None,
|
||||
email="SomeValidEmail@email.com",
|
||||
username="SomeValidUsername",
|
||||
password="SomeValidPassword",
|
||||
password_confirm="SomeValidPassword",
|
||||
advanced=False,
|
||||
private=True,
|
||||
)
|
||||
|
||||
CreateUserRegistration(
|
||||
group=None,
|
||||
group_token="asdfadsfasdfasdfasdf",
|
||||
email="SomeValidEmail@email.com",
|
||||
username="SomeValidUsername",
|
||||
password="SomeValidPassword",
|
||||
password_confirm="SomeValidPassword",
|
||||
advanced=False,
|
||||
private=True,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("group, group_token", [(None, None), ("", None), (None, "")])
|
||||
def test_group_or_token_validator(group, group_token) -> None:
|
||||
with pytest.raises(ValueError):
|
||||
CreateUserRegistration(
|
||||
group=group,
|
||||
group_token=group_token,
|
||||
email="SomeValidEmail@email.com",
|
||||
username="SomeValidUsername",
|
||||
password="SomeValidPassword",
|
||||
password_confirm="SomeValidPassword",
|
||||
advanced=False,
|
||||
private=True,
|
||||
)
|
||||
|
||||
|
||||
def test_group_no_args_passed() -> None:
|
||||
with pytest.raises(ValueError):
|
||||
CreateUserRegistration(
|
||||
email="SomeValidEmail@email.com",
|
||||
username="SomeValidUsername",
|
||||
password="SomeValidPassword",
|
||||
password_confirm="SomeValidPassword",
|
||||
advanced=False,
|
||||
private=True,
|
||||
)
|
||||
|
||||
|
||||
def test_password_validator() -> None:
|
||||
with pytest.raises(ValueError):
|
||||
CreateUserRegistration(
|
||||
group=None,
|
||||
group_token="asdfadsfasdfasdfasdf",
|
||||
email="SomeValidEmail@email.com",
|
||||
username="SomeValidUsername",
|
||||
password="SomeValidPassword",
|
||||
password_confirm="PasswordDefNotMatch",
|
||||
advanced=False,
|
||||
private=True,
|
||||
)
|
||||
|
||||
|
||||
test_create_user_registration()
|
Loading…
Add table
Add a link
Reference in a new issue