mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-05-15 22:37:32 -04:00
added runtime check for this
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import pytest
|
||||
import sqlalchemy as sa
|
||||
|
||||
from mealie.db.models._model_base import PrivateColumn
|
||||
from mealie.db.models.recipe.recipe import RecipeModel
|
||||
from mealie.db.models.users.users import LongLiveToken, User
|
||||
from mealie.services.query_filter.builder import (
|
||||
@@ -87,6 +88,12 @@ def test_query_filter_builder_json_uses_raw_value():
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def test_private_column_rejects_list_type():
|
||||
"""PrivateColumn[list[X]] must raise TypeError at definition time to prevent misuse on relationships."""
|
||||
with pytest.raises(TypeError, match="relationship"):
|
||||
PrivateColumn[list[User]]
|
||||
|
||||
|
||||
def test_private_field_user_password_raises():
|
||||
"""Filtering on User.password (PrivateColumn) should raise ValueError."""
|
||||
with pytest.raises(ValueError, match="private field"):
|
||||
|
||||
Reference in New Issue
Block a user