import uuid from inkwell.acl import visible_to_user from inkwell.models.user import User def test_visible_to_user_builds_owner_or_shared_predicate(): """DB-free smoke test: the predicate compiles and references both the direct (shares) and group (group_members) grant paths. Row visibility against a real database is in test_integration.py. """ uid = uuid.uuid4() # User stands in as a shareable resource purely to exercise the SQL builder. clause = visible_to_user("note", User.id, User.id, uid) sql = str(clause).lower() assert "shares" in sql assert "group_members" in sql