Skip to content

Commit

Permalink
run black to format code
Browse files Browse the repository at this point in the history
  • Loading branch information
tedw87 committed Oct 30, 2024
1 parent c0dd605 commit e51b6aa
Showing 1 changed file with 12 additions and 36 deletions.
48 changes: 12 additions & 36 deletions src/plone/restapi/tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,50 +153,26 @@ def test_search_on_context_constrains_query_by_path(self):

def test_search_with_parentheses(self):
query = {"SearchableText": "("}
response = self.api_session.get(
"/@search",
params=query
)
self.assertEqual(
response.status_code,
200
)
response = self.api_session.get("/@search", params=query)
self.assertEqual(response.status_code, 200)
self.assertEqual(
response.json(),
[],
"Expected no items for query with only parentheses"
)
response.json(), [], "Expected no items for query with only parentheses"
)

query = {"SearchableText": ")"}
response = self.api_session.get(
"/@search",
params=query
)
self.assertEqual(
response.status_code,
200
)
response = self.api_session.get("/@search", params=query)
self.assertEqual(response.status_code, 200)
self.assertEqual(
response.json(),
[],
"Expected no items for query with only parentheses"
)
response.json(), [], "Expected no items for query with only parentheses"
)

query = {"SearchableText": "lorem(ipsum)"}
response = self.api_session.get(
"/@search",
params=query
)
self.assertEqual(
response.status_code,
200
)
response = self.api_session.get("/@search", params=query)
self.assertEqual(response.status_code, 200)
items = [item["title"] for item in response.json().get("items", [])]
self.assertIn(
"Lorem Ipsum",
items,
"Expected 'Lorem Ipsum' to be found in search results"
)
"Lorem Ipsum", items, "Expected 'Lorem Ipsum' to be found in search results"
)

def test_search_in_vhm(self):
# Install a Virtual Host Monster
Expand Down

0 comments on commit e51b6aa

Please sign in to comment.