Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
pbauer committed Dec 20, 2024
1 parent 0da4d70 commit c6cfdb4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/plone/api/tests/test_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,16 @@ def test_get(self):
# title is an attribute
self.assertIsNone(api.content.get("/about/team/title"))

def test_get_of_content_in_inaccessible_container(self):
"""Test getting items in a inaccessible container.
Worked in Plone 5.1 but raised Unauthorized since 5.2."""
api.content.transition(obj=self.team, transition="publish")
with api.env.adopt_roles(["Member"]):
team_by_path = api.content.get("/about/team")
self.assertEqual(self.team, team_by_path)
team_by_uid = api.content.get(UID=self.team.UID())
self.assertEqual(self.team, team_by_uid)

def test_move_constraints(self):
"""Test the constraints for moving content."""
from plone.api.exc import MissingParameterError
Expand Down

0 comments on commit c6cfdb4

Please sign in to comment.