forked from plone/plone.restapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquerystring-search.py
94 lines (89 loc) · 2.87 KB
/
querystring-search.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
from locust import HttpUser
from locust import task
class QuerystringSearchAnonymousUser(HttpUser):
@task
def querystring_search_root(self):
headers = {
"Accept": "application/json",
"Authorization": "Basic YWRtaW46YWRtaW4=",
"Content-Type": "application/json",
}
self.client.post(
"/@querystring-search",
headers=headers,
json={
"query": [
{
"i": "portal_type",
"o": "plone.app.querystring.operation.selection.any",
"v": ["Document"],
}
]
},
name="Querystring Search (Root)",
)
@task
def querystring_search_root_fullobjects_true(self):
headers = {
"Accept": "application/json",
"Authorization": "Basic YWRtaW46YWRtaW4=",
"Content-Type": "application/json",
}
self.client.post(
"/@querystring-search",
headers=headers,
json={
"query": [
{
"i": "portal_type",
"o": "plone.app.querystring.operation.selection.any",
"v": ["Document"],
}
],
"fullobjects": 1,
},
name="Querystring Search (Root, Fullobjects=1)",
)
@task
def querystring_search_content(self):
headers = {
"Accept": "application/json",
"Authorization": "Basic YWRtaW46YWRtaW4=",
"Content-Type": "application/json",
}
self.client.post(
"/testfolder-read/document/@querystring-search",
headers=headers,
json={
"query": [
{
"i": "portal_type",
"o": "plone.app.querystring.operation.selection.any",
"v": ["Document"],
}
]
},
name="Querystring Search (Content)",
)
@task
def querystring_search_content_fullobjects_true(self):
headers = {
"Accept": "application/json",
"Authorization": "Basic YWRtaW46YWRtaW4=",
"Content-Type": "application/json",
}
self.client.post(
"/testfolder-read/document/@querystring-search",
headers=headers,
json={
"query": [
{
"i": "portal_type",
"o": "plone.app.querystring.operation.selection.any",
"v": ["Document"],
}
],
"fullobjects": 1,
},
name="Querystring Search (Content, Fullobjects=1)",
)