1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-05 21:45:25 +02:00

Merge branch 'mealie-next' into fix/translation-issues-when-scraping

This commit is contained in:
boc-the-git 2024-02-08 20:58:43 +11:00 committed by GitHub
commit 36088f0db9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 72 additions and 25 deletions

View file

@ -1,11 +1,36 @@
import pytest
from fastapi.testclient import TestClient
from mealie.core.config import get_app_settings
from mealie.core.settings.static import APP_VERSION
from mealie.repos.repository_factory import AllRepositories
from tests.utils import api_routes
from tests.utils.fixture_schemas import TestUser
@pytest.mark.parametrize("is_private_group", [True, False], ids=["private group", "public group"])
def test_public_about_get_app_info(api_client: TestClient, is_private_group: bool, database: AllRepositories):
settings = get_app_settings()
group = database.groups.get_by_name(settings.DEFAULT_GROUP)
assert group and group.preferences
group.preferences.private_group = is_private_group
database.group_preferences.update(group.id, group.preferences)
response = api_client.get(api_routes.app_about)
as_dict = response.json()
assert as_dict["production"] == settings.PRODUCTION
assert as_dict["version"] == APP_VERSION
assert as_dict["demoStatus"] == settings.IS_DEMO
assert as_dict["allowSignup"] == settings.ALLOW_SIGNUP
if is_private_group:
assert as_dict["defaultGroupSlug"] == None
else:
assert as_dict["defaultGroupSlug"] == group.slug
def test_admin_about_get_app_info(api_client: TestClient, admin_user: TestUser):
response = api_client.get(api_routes.admin_about, headers=admin_user.token)