1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-03 04:25:24 +02:00

Fix/fix block registration (#1059)

* fix disable button

* add backend env for restricting registration

* update state management

* add allow_signup to app info

* move allow_signup to backend only

* cleanup docker-compose

* potential darkmode fix

* fix missing variable

* add banner on login page

* use random bools for tests

* fix initial state bug

* fix state reset
This commit is contained in:
Hayden 2022-03-15 17:34:53 -08:00 committed by GitHub
parent 3c2744a3da
commit 13e157827c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 107 additions and 52 deletions

View file

@ -16,9 +16,8 @@ def test_get_preferences(api_client: TestClient, unique_user: TestUser) -> None:
preferences = response.json()
# Spot Check Defaults
assert preferences["recipePublic"] is True
assert preferences["recipeShowNutrition"] is False
assert preferences["recipePublic"] in {True, False}
assert preferences["recipeShowNutrition"] in {True, False}
def test_preferences_in_group(api_client: TestClient, unique_user: TestUser) -> None:
@ -31,8 +30,8 @@ def test_preferences_in_group(api_client: TestClient, unique_user: TestUser) ->
assert group["preferences"] is not None
# Spot Check
assert group["preferences"]["recipePublic"] is True
assert group["preferences"]["recipeShowNutrition"] is False
assert group["preferences"]["recipePublic"] in {True, False}
assert group["preferences"]["recipeShowNutrition"] in {True, False}
def test_update_preferences(api_client: TestClient, unique_user: TestUser) -> None:

View file

@ -16,13 +16,13 @@ def random_bool() -> bool:
return bool(random.getrandbits(1))
def user_registration_factory() -> CreateUserRegistration:
def user_registration_factory(advanced=None, private=None) -> CreateUserRegistration:
return CreateUserRegistration(
group=random_string(),
email=random_email(),
username=random_string(),
password="fake-password",
password_confirm="fake-password",
advanced=False,
private=False,
advanced=advanced or random_bool(),
private=private or random_bool(),
)