Skip to content

Commit

Permalink
fix(search): Fixed failing test_disallowed_wildcard_pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
albertisfu committed Jan 11, 2025
1 parent cfde145 commit 29712cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cl/search/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1242,9 +1242,14 @@ def test_disallowed_wildcard_pattern(self) -> None:
test_case["search_params"],
)
decoded_content = response.content.decode()
tree = html.fromstring(decoded_content)
h2_error_element = tree.xpath('//h2[@class="alt"]')[0]
h2_text_error = "".join(
h2_error_element.xpath(".//text()")
).strip()
self.assertIn(
"The query contains a disallowed expensive wildcard pattern",
decoded_content,
h2_text_error,
msg=f"Failed on: {test_case['label']}, no disallowed wildcard pattern error.",
)

Expand Down

0 comments on commit 29712cc

Please sign in to comment.