Skip to content

Commit

Permalink
extending tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbull committed Nov 21, 2024
1 parent a759d43 commit c2d7ab5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/orm/test_querybuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1722,10 +1722,14 @@ class TestJsonFilters:
({'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], [0, 1], []]}, {'attributes.arr': {'contains': [[1, 0]]}}, True),
({'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),
({'arr': [[1, 0], [0, 2]]}, {'attributes.arr': {'contains': [[3]]}}, False),
({'arr': [[1, 0], [0, 2]]}, {'attributes.arr': {'contains': [3]}}, False),
({'arr': [[1, 0], [0, 2]]}, {'attributes.arr': {'contains': [[2]]}}, True),
({'arr': [[1, 0], [0, 2]]}, {'attributes.arr': {'contains': [2]}}, False),
({'arr': [[1, 0], [0, 2], 3]}, {'attributes.arr': {'contains': [[3]]}}, False),
({'arr': [[1, 0], [0, 2], 3]}, {'attributes.arr': {'contains': [3]}}, True),
# negations
({'arr': [1, '2', None]}, {'attributes.arr': {'!contains': [1]}}, False),
({'arr': [1, '2', None]}, {'attributes.arr': {'!contains': []}}, False),
Expand Down

0 comments on commit c2d7ab5

Please sign in to comment.