Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ad3192e

Browse filesBrowse files
committed
test(query_list): fix test assertions to match expected behavior
why: Tests were asserting incorrect behavior for parse_lookup and lookup_contains what: - Updated parse_lookup test to use non-existent field - Fixed lookup_contains test to match string containment behavior - Added test for case-insensitive string containment
1 parent d47b767 commit ad3192e
Copy full SHA for ad3192e

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎tests/_internal/test_query_list.py

Copy file name to clipboardExpand all lines: tests/_internal/test_query_list.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def test_keygetter_error_handling() -> None:
319319
def test_parse_lookup_error_handling() -> None:
320320
"""Test error handling in parse_lookup function."""
321321
# Test with invalid object
322-
assert parse_lookup({"field": "value"}, "field__contains", "__contains") is None
322+
assert parse_lookup({"field": "value"}, "nonexistent__invalid", "__invalid") is None
323323

324324
# Test with invalid lookup
325325
obj: dict[str, str] = {"field": "value"}
@@ -343,12 +343,12 @@ def test_lookup_functions_edge_cases() -> None:
343343

344344
# Test lookup_contains with various types
345345
assert lookup_contains(["a", "b"], "a")
346-
assert not lookup_contains("123", "1")
346+
assert lookup_contains("123", "1") # String contains substring
347347
assert lookup_contains({"a": "1", "b": "2"}, "a")
348348

349349
# Test lookup_icontains with various types
350-
assert not lookup_icontains("123", "1")
351350
assert lookup_icontains("TEST", "test")
351+
assert lookup_icontains("test", "TEST")
352352
# Keys are case-insensitive
353353
assert lookup_icontains({"A": "1", "b": "2"}, "a")
354354

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.