Skip to content
Merged

Sync #44

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
tests: add case query array, {} multiple condition to a same field
  • Loading branch information
zhangchunlin committed Oct 29, 2019
commit 4ee6f67ad9cdfc7ba237a22de53eb85a139c909c
16 changes: 16 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,22 @@ def test_apijson_get():
>>> print(d)
{'code': 200, 'msg': 'success', '[]': [{'user': {'username': 'userb', 'nickname': 'User B', 'id': 3}}, {'user': {'username': 'userc', 'nickname': 'User C', 'id': 4}}]}

>>> #query array, {} multiple condition to a same field
>>> data ='''{
... "[]":{
... "user": {
... "@role": "ADMIN",
... "id&{}": ">2,<=4",
... "id{}": "!=3",
... "@column": "username,nickname,id"
... }
... }
... }'''
>>> r = handler.post('/apijson/get', data=data, pre_call=pre_call_as("admin"), middlewares=[])
>>> d = json_loads(r.data)
>>> print(d)
{'code': 200, 'msg': 'success', '[]': [{'user': {'username': 'userc', 'nickname': 'User C', 'id': 4}}]}

>>> #query array, !{} condition list
>>> data ='''{
... "[]":{
Expand Down