Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Sync#44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
TommyLemon merged 2 commits intoAPIJSON:masterfromzhangchunlin:master
Nov 1, 2019
Merged
Changes from1 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
PrevPrevious commit
tests: add case query array, {} multiple condition to a same field
  • Loading branch information
@zhangchunlin
zhangchunlin committedOct 29, 2019
commit4ee6f67ad9cdfc7ba237a22de53eb85a139c909c
16 changes: 16 additions & 0 deletionstests/test.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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

[8]ページ先頭

©2009-2025 Movatter.jp