Skip to content

Commit

Permalink
add tests for nested arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbull committed Nov 19, 2024
1 parent 518cc6b commit 474dd26
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/orm/test_querybuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,15 @@ class TestJsonFilters:
# contains empty set
({'arr': [1, '2', None]}, {'attributes.arr': {'contains': []}}, True),
({'arr': []}, {'attributes.arr': {'contains': []}}, True),
# nested arrays
({'arr': [[1, 0], [0, 2]]}, {'attributes.arr': {'contains': [[1, 0]]}}, True),
({'arr': [[2, 3], [0, 1], []]}, {'attributes.arr': {'contains': [[1, 0]]}}, True), # order doesn't matter
({'arr': [[2, 3], [1]]}, {'attributes.arr': {'contains': [[4]]}}, False),
# TODO: the test below is supposed to pass but currently doesn't
# ({'arr': [[2, 3], [1]]}, {'attributes.arr': {'contains': [[2]]}}, False),
# negations
({'arr': [1, '2', None]}, {'attributes.arr': {'!contains': [1]}}, False),
({'arr': [1, '2', None]}, {'attributes.arr': {'!contains': []}}, False),
Expand Down

0 comments on commit 474dd26

Please sign in to comment.