Skip to content

Commit 4ee6f67

Browse files
committed
tests: add case query array, {} multiple condition to a same field
1 parent 75272b5 commit 4ee6f67

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,22 @@ def test_apijson_get():
951951
>>> print(d)
952952
{'code': 200, 'msg': 'success', '[]': [{'user': {'username': 'userb', 'nickname': 'User B', 'id': 3}}, {'user': {'username': 'userc', 'nickname': 'User C', 'id': 4}}]}
953953
954+
>>> #query array, {} multiple condition to a same field
955+
>>> data ='''{
956+
... "[]":{
957+
... "user": {
958+
... "@role": "ADMIN",
959+
... "id&{}": ">2,<=4",
960+
... "id{}": "!=3",
961+
... "@column": "username,nickname,id"
962+
... }
963+
... }
964+
... }'''
965+
>>> r = handler.post('/apijson/get', data=data, pre_call=pre_call_as("admin"), middlewares=[])
966+
>>> d = json_loads(r.data)
967+
>>> print(d)
968+
{'code': 200, 'msg': 'success', '[]': [{'user': {'username': 'userc', 'nickname': 'User C', 'id': 4}}]}
969+
954970
>>> #query array, !{} condition list
955971
>>> data ='''{
956972
... "[]":{

0 commit comments

Comments
 (0)