Skip to content

Commit

Permalink
Log out for unrestricted search test
Browse files Browse the repository at this point in the history
  • Loading branch information
gogobd committed Feb 20, 2024
1 parent 5783c42 commit 5101fdc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/plone/api/tests/test_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,10 +915,18 @@ def test_find(self):
def test_untrestricted_find(self):
"""Test the finding of content in with unrestricted search."""

# Find documents
# Search as Anonymous user
from plone.app.testing import logout
logout()

# Find documents (unrestricted)
documents = api.content.find(portal_type="Document", unrestricted=True)
self.assertEqual(len(documents), 2)

# Find documents (restricted)
documents = api.content.find(portal_type="Document")
self.assertEqual(len(documents), 0)

def test_find_empty_query(self):
"""Make sure an empty query yields no results"""

Expand Down

0 comments on commit 5101fdc

Please sign in to comment.