aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2019-06-22 22:48:30 +0200
committerLorenz Diener <[email protected]>2019-06-22 22:48:30 +0200
commitf920f8b58429b5d7dea43442765df824ac04bf91 (patch)
tree3e74d678329a290156889d8e2d48a384381c1deb /tests
parentadd974ae2985a8af72a0e2e4182e2eccec8d309c (diff)
downloadmastodon.py-f920f8b58429b5d7dea43442765df824ac04bf91.tar.gz
Add final round of tests for moderation API
Diffstat (limited to 'tests')
-rw-r--r--tests/cassettes/test_admin_reports.yaml382
-rw-r--r--tests/test_admin.py38
2 files changed, 419 insertions, 1 deletions
diff --git a/tests/cassettes/test_admin_reports.yaml b/tests/cassettes/test_admin_reports.yaml
new file mode 100644
index 0000000..93c083f
--- /dev/null
+++ b/tests/cassettes/test_admin_reports.yaml
@@ -0,0 +1,382 @@
1interactions:
2- request:
3 body: status=Toot%21
4 headers:
5 Accept: ['*/*']
6 Accept-Encoding: ['gzip, deflate']
7 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
8 Connection: [keep-alive]
9 Content-Length: ['14']
10 Content-Type: [application/x-www-form-urlencoded]
11 User-Agent: [python-requests/2.18.4]
12 method: POST
13 uri: http://localhost:3000/api/v1/statuses
14 response:
15 body: {string: '{"id":"102317184522339970","created_at":"2019-06-22T20:45:36.102Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/102317184522339970","url":"http://localhost/@mastodonpy_test/102317184522339970","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
16 test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
17 headers:
18 Cache-Control: ['no-cache, no-store']
19 Content-Type: [application/json; charset=utf-8]
20 Referrer-Policy: [strict-origin-when-cross-origin]
21 Transfer-Encoding: [chunked]
22 Vary: ['Accept-Encoding, Origin']
23 X-Content-Type-Options: [nosniff]
24 X-Download-Options: [noopen]
25 X-Frame-Options: [SAMEORIGIN]
26 X-Permitted-Cross-Domain-Policies: [none]
27 X-Request-Id: [85fbbf6c-0fda-4f95-b0dc-48ac98c47805]
28 X-Runtime: ['0.143998']
29 X-XSS-Protection: [1; mode=block]
30 content-length: ['1236']
31 status: {code: 200, message: OK}
32- request:
33 body: null
34 headers:
35 Accept: ['*/*']
36 Accept-Encoding: ['gzip, deflate']
37 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
38 Connection: [keep-alive]
39 User-Agent: [python-requests/2.18.4]
40 method: GET
41 uri: http://localhost:3000/api/v1/accounts/verify_credentials
42 response:
43 body: {string: '{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"source":{"privacy":"public","sensitive":false,"language":null,"note":"","fields":[]},"emojis":[],"fields":[]}'}
44 headers:
45 Cache-Control: ['no-cache, no-store']
46 Content-Type: [application/json; charset=utf-8]
47 Referrer-Policy: [strict-origin-when-cross-origin]
48 Transfer-Encoding: [chunked]
49 Vary: ['Accept-Encoding, Origin']
50 X-Content-Type-Options: [nosniff]
51 X-Download-Options: [noopen]
52 X-Frame-Options: [SAMEORIGIN]
53 X-Permitted-Cross-Domain-Policies: [none]
54 X-Request-Id: [167b4850-c12e-44b0-a060-af569f561bde]
55 X-Runtime: ['0.035276']
56 X-XSS-Protection: [1; mode=block]
57 content-length: ['654']
58 status: {code: 200, message: OK}
59- request:
60 body: null
61 headers:
62 Accept: ['*/*']
63 Accept-Encoding: ['gzip, deflate']
64 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
65 Connection: [keep-alive]
66 User-Agent: [python-requests/2.18.4]
67 method: GET
68 uri: http://localhost:3000/api/v1/accounts/verify_credentials
69 response:
70 body: {string: '{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"source":{"privacy":"public","sensitive":false,"language":null,"note":"","fields":[]},"emojis":[],"fields":[]}'}
71 headers:
72 Cache-Control: ['no-cache, no-store']
73 Content-Type: [application/json; charset=utf-8]
74 Referrer-Policy: [strict-origin-when-cross-origin]
75 Transfer-Encoding: [chunked]
76 Vary: ['Accept-Encoding, Origin']
77 X-Content-Type-Options: [nosniff]
78 X-Download-Options: [noopen]
79 X-Frame-Options: [SAMEORIGIN]
80 X-Permitted-Cross-Domain-Policies: [none]
81 X-Request-Id: [ea5de9ba-7d6d-4403-bfb6-5cedb62d9cab]
82 X-Runtime: ['0.021088']
83 X-XSS-Protection: [1; mode=block]
84 content-length: ['609']
85 status: {code: 200, message: OK}
86- request:
87 body: comment=api+crimes&account_id=1234567890123456&status_ids%5B%5D=102317184522339970
88 headers:
89 Accept: ['*/*']
90 Accept-Encoding: ['gzip, deflate']
91 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
92 Connection: [keep-alive]
93 Content-Length: ['82']
94 Content-Type: [application/x-www-form-urlencoded]
95 User-Agent: [python-requests/2.18.4]
96 method: POST
97 uri: http://localhost:3000/api/v1/reports/
98 response:
99 body: {string: '{"id":"7","action_taken":false}'}
100 headers:
101 Cache-Control: ['no-cache, no-store']
102 Content-Type: [application/json; charset=utf-8]
103 Referrer-Policy: [strict-origin-when-cross-origin]
104 Transfer-Encoding: [chunked]
105 Vary: ['Accept-Encoding, Origin']
106 X-Content-Type-Options: [nosniff]
107 X-Download-Options: [noopen]
108 X-Frame-Options: [SAMEORIGIN]
109 X-Permitted-Cross-Domain-Policies: [none]
110 X-Request-Id: [d82c8adf-230b-4afa-b013-a10f696b391d]
111 X-Runtime: ['0.031687']
112 X-XSS-Protection: [1; mode=block]
113 content-length: ['31']
114 status: {code: 200, message: OK}
115- request:
116 body: null
117 headers:
118 Accept: ['*/*']
119 Accept-Encoding: ['gzip, deflate']
120 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
121 Connection: [keep-alive]
122 User-Agent: [python-requests/2.18.4]
123 method: GET
124 uri: http://localhost:3000/api/v1/admin/reports
125 response:
126 body: {string: '[{"id":"7","action_taken":false,"comment":"api crimes","created_at":"2019-06-22T20:45:36.323Z","updated_at":"2019-06-22T20:45:36.323Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[{"id":"102317184522339970","created_at":"2019-06-22T20:45:36.102Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/102317184522339970","url":"http://localhost/@mastodonpy_test/102317184522339970","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
127 test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]},{"id":"6","action_taken":false,"comment":"api
128 crimes","created_at":"2019-06-22T20:45:12.675Z","updated_at":"2019-06-22T20:45:12.942Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[]},{"id":"5","action_taken":false,"comment":"api
129 crimes","created_at":"2019-06-22T20:44:47.549Z","updated_at":"2019-06-22T20:44:47.779Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[]},{"id":"2","action_taken":false,"comment":"api
130 crimes","created_at":"2019-06-22T20:41:42.147Z","updated_at":"2019-06-22T20:41:42.147Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[]}]'}
131 headers:
132 Cache-Control: ['no-cache, no-store']
133 Content-Type: [application/json; charset=utf-8]
134 Link: ['<http://localhost:3000/api/v1/admin/reports?min_id=7>; rel="prev"']
135 Referrer-Policy: [strict-origin-when-cross-origin]
136 Transfer-Encoding: [chunked]
137 Vary: ['Accept-Encoding, Origin']
138 X-Content-Type-Options: [nosniff]
139 X-Download-Options: [noopen]
140 X-Frame-Options: [SAMEORIGIN]
141 X-Permitted-Cross-Domain-Policies: [none]
142 X-Request-Id: [920afaa7-5e85-44de-b5b0-c24c1d149ed5]
143 X-Runtime: ['0.079723']
144 X-XSS-Protection: [1; mode=block]
145 content-length: ['8854']
146 status: {code: 200, message: OK}
147- request:
148 body: null
149 headers:
150 Accept: ['*/*']
151 Accept-Encoding: ['gzip, deflate']
152 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
153 Connection: [keep-alive]
154 Content-Length: ['0']
155 User-Agent: [python-requests/2.18.4]
156 method: POST
157 uri: http://localhost:3000/api/v1/admin/reports/7/resolve
158 response:
159 body: {string: '{"id":"7","action_taken":true,"comment":"api crimes","created_at":"2019-06-22T20:45:36.323Z","updated_at":"2019-06-22T20:45:36.450Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"statuses":[{"id":"102317184522339970","created_at":"2019-06-22T20:45:36.102Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/102317184522339970","url":"http://localhost/@mastodonpy_test/102317184522339970","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
160 test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]}'}
161 headers:
162 Cache-Control: ['no-cache, no-store']
163 Content-Type: [application/json; charset=utf-8]
164 Referrer-Policy: [strict-origin-when-cross-origin]
165 Transfer-Encoding: [chunked]
166 Vary: ['Accept-Encoding, Origin']
167 X-Content-Type-Options: [nosniff]
168 X-Download-Options: [noopen]
169 X-Frame-Options: [SAMEORIGIN]
170 X-Permitted-Cross-Domain-Policies: [none]
171 X-Request-Id: [dd9cc46f-e76b-4c99-8fb2-f8d93235af86]
172 X-Runtime: ['0.102350']
173 X-XSS-Protection: [1; mode=block]
174 content-length: ['3919']
175 status: {code: 200, message: OK}
176- request:
177 body: null
178 headers:
179 Accept: ['*/*']
180 Accept-Encoding: ['gzip, deflate']
181 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
182 Connection: [keep-alive]
183 User-Agent: [python-requests/2.18.4]
184 method: GET
185 uri: http://localhost:3000/api/v1/admin/reports
186 response:
187 body: {string: '[{"id":"6","action_taken":false,"comment":"api crimes","created_at":"2019-06-22T20:45:12.675Z","updated_at":"2019-06-22T20:45:12.942Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[]},{"id":"5","action_taken":false,"comment":"api
188 crimes","created_at":"2019-06-22T20:44:47.549Z","updated_at":"2019-06-22T20:44:47.779Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[]},{"id":"2","action_taken":false,"comment":"api
189 crimes","created_at":"2019-06-22T20:41:42.147Z","updated_at":"2019-06-22T20:41:42.147Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[]}]'}
190 headers:
191 Cache-Control: ['no-cache, no-store']
192 Content-Type: [application/json; charset=utf-8]
193 Link: ['<http://localhost:3000/api/v1/admin/reports?min_id=6>; rel="prev"']
194 Referrer-Policy: [strict-origin-when-cross-origin]
195 Transfer-Encoding: [chunked]
196 Vary: ['Accept-Encoding, Origin']
197 X-Content-Type-Options: [nosniff]
198 X-Download-Options: [noopen]
199 X-Frame-Options: [SAMEORIGIN]
200 X-Permitted-Cross-Domain-Policies: [none]
201 X-Request-Id: [30e971c7-480f-42f2-a87b-de31c157ce58]
202 X-Runtime: ['0.050394']
203 X-XSS-Protection: [1; mode=block]
204 content-length: ['5725']
205 status: {code: 200, message: OK}
206- request:
207 body: null
208 headers:
209 Accept: ['*/*']
210 Accept-Encoding: ['gzip, deflate']
211 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
212 Connection: [keep-alive]
213 Content-Length: ['0']
214 User-Agent: [python-requests/2.18.4]
215 method: POST
216 uri: http://localhost:3000/api/v1/admin/reports/7/reopen
217 response:
218 body: {string: '{"id":"7","action_taken":false,"comment":"api crimes","created_at":"2019-06-22T20:45:36.323Z","updated_at":"2019-06-22T20:45:36.621Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[{"id":"102317184522339970","created_at":"2019-06-22T20:45:36.102Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/102317184522339970","url":"http://localhost/@mastodonpy_test/102317184522339970","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
219 test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]}'}
220 headers:
221 Cache-Control: ['no-cache, no-store']
222 Content-Type: [application/json; charset=utf-8]
223 Referrer-Policy: [strict-origin-when-cross-origin]
224 Transfer-Encoding: [chunked]
225 Vary: ['Accept-Encoding, Origin']
226 X-Content-Type-Options: [nosniff]
227 X-Download-Options: [noopen]
228 X-Frame-Options: [SAMEORIGIN]
229 X-Permitted-Cross-Domain-Policies: [none]
230 X-Request-Id: [0dfa2721-c9a5-469b-bb1c-e272629c8499]
231 X-Runtime: ['0.075180']
232 X-XSS-Protection: [1; mode=block]
233 content-length: ['3128']
234 status: {code: 200, message: OK}
235- request:
236 body: null
237 headers:
238 Accept: ['*/*']
239 Accept-Encoding: ['gzip, deflate']
240 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
241 Connection: [keep-alive]
242 User-Agent: [python-requests/2.18.4]
243 method: GET
244 uri: http://localhost:3000/api/v1/admin/reports
245 response:
246 body: {string: '[{"id":"7","action_taken":false,"comment":"api crimes","created_at":"2019-06-22T20:45:36.323Z","updated_at":"2019-06-22T20:45:36.621Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[{"id":"102317184522339970","created_at":"2019-06-22T20:45:36.102Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/102317184522339970","url":"http://localhost/@mastodonpy_test/102317184522339970","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
247 test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]},{"id":"6","action_taken":false,"comment":"api
248 crimes","created_at":"2019-06-22T20:45:12.675Z","updated_at":"2019-06-22T20:45:12.942Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[]},{"id":"5","action_taken":false,"comment":"api
249 crimes","created_at":"2019-06-22T20:44:47.549Z","updated_at":"2019-06-22T20:44:47.779Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[]},{"id":"2","action_taken":false,"comment":"api
250 crimes","created_at":"2019-06-22T20:41:42.147Z","updated_at":"2019-06-22T20:41:42.147Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[]}]'}
251 headers:
252 Cache-Control: ['no-cache, no-store']
253 Content-Type: [application/json; charset=utf-8]
254 Link: ['<http://localhost:3000/api/v1/admin/reports?min_id=7>; rel="prev"']
255 Referrer-Policy: [strict-origin-when-cross-origin]
256 Transfer-Encoding: [chunked]
257 Vary: ['Accept-Encoding, Origin']
258 X-Content-Type-Options: [nosniff]
259 X-Download-Options: [noopen]
260 X-Frame-Options: [SAMEORIGIN]
261 X-Permitted-Cross-Domain-Policies: [none]
262 X-Request-Id: [80dd9db1-6fc2-4f82-812e-2d32da16031e]
263 X-Runtime: ['0.085853']
264 X-XSS-Protection: [1; mode=block]
265 content-length: ['8854']
266 status: {code: 200, message: OK}
267- request:
268 body: null
269 headers:
270 Accept: ['*/*']
271 Accept-Encoding: ['gzip, deflate']
272 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
273 Connection: [keep-alive]
274 Content-Length: ['0']
275 User-Agent: [python-requests/2.18.4]
276 method: POST
277 uri: http://localhost:3000/api/v1/admin/reports/7/assign_to_self
278 response:
279 body: {string: '{"id":"7","action_taken":false,"comment":"api crimes","created_at":"2019-06-22T20:45:36.323Z","updated_at":"2019-06-22T20:45:36.801Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"action_taken_by_account":null,"statuses":[{"id":"102317184522339970","created_at":"2019-06-22T20:45:36.102Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/102317184522339970","url":"http://localhost/@mastodonpy_test/102317184522339970","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
280 test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]}'}
281 headers:
282 Cache-Control: ['no-cache, no-store']
283 Content-Type: [application/json; charset=utf-8]
284 Referrer-Policy: [strict-origin-when-cross-origin]
285 Transfer-Encoding: [chunked]
286 Vary: ['Accept-Encoding, Origin']
287 X-Content-Type-Options: [nosniff]
288 X-Download-Options: [noopen]
289 X-Frame-Options: [SAMEORIGIN]
290 X-Permitted-Cross-Domain-Policies: [none]
291 X-Request-Id: [2f01d6ef-578c-461d-9a31-daa924aa2538]
292 X-Runtime: ['0.077553']
293 X-XSS-Protection: [1; mode=block]
294 content-length: ['3920']
295 status: {code: 200, message: OK}
296- request:
297 body: null
298 headers:
299 Accept: ['*/*']
300 Accept-Encoding: ['gzip, deflate']
301 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
302 Connection: [keep-alive]
303 Content-Length: ['0']
304 User-Agent: [python-requests/2.18.4]
305 method: POST
306 uri: http://localhost:3000/api/v1/admin/reports/7/unassign
307 response:
308 body: {string: '{"id":"7","action_taken":false,"comment":"api crimes","created_at":"2019-06-22T20:45:36.323Z","updated_at":"2019-06-22T20:45:36.889Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[{"id":"102317184522339970","created_at":"2019-06-22T20:45:36.102Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/102317184522339970","url":"http://localhost/@mastodonpy_test/102317184522339970","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
309 test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]}'}
310 headers:
311 Cache-Control: ['no-cache, no-store']
312 Content-Type: [application/json; charset=utf-8]
313 Referrer-Policy: [strict-origin-when-cross-origin]
314 Transfer-Encoding: [chunked]
315 Vary: ['Accept-Encoding, Origin']
316 X-Content-Type-Options: [nosniff]
317 X-Download-Options: [noopen]
318 X-Frame-Options: [SAMEORIGIN]
319 X-Permitted-Cross-Domain-Policies: [none]
320 X-Request-Id: [4b3bdc24-fa76-483a-9d39-46b11169b09a]
321 X-Runtime: ['0.073337']
322 X-XSS-Protection: [1; mode=block]
323 content-length: ['3128']
324 status: {code: 200, message: OK}
325- request:
326 body: null
327 headers:
328 Accept: ['*/*']
329 Accept-Encoding: ['gzip, deflate']
330 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN_2]
331 Connection: [keep-alive]
332 User-Agent: [python-requests/2.18.4]
333 method: GET
334 uri: http://localhost:3000/api/v1/admin/reports/7
335 response:
336 body: {string: '{"id":"7","action_taken":false,"comment":"api crimes","created_at":"2019-06-22T20:45:36.323Z","updated_at":"2019-06-22T20:45:36.889Z","account":{"id":"1","username":"admin","domain":null,"created_at":"2019-06-22T12:42:50.096Z","email":"admin@localhost","ip":"127.0.0.1","role":"admin","confirmed":true,"suspended":false,"silenced":false,"disabled":false,"approved":true,"locale":null,"invite_request":null,"account":{"id":"1","username":"admin","acct":"admin","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T12:42:50.096Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@admin","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":1,"following_count":0,"statuses_count":7,"emojis":[],"fields":[]}},"target_account":{"id":"1234567890123456","username":"mastodonpy_test","domain":null,"created_at":"2019-06-22T22:24:48.478Z","email":"mastodonpy_test@localhost:3000","ip":"127.0.0.1","role":"user","confirmed":true,"suspended":true,"silenced":false,"disabled":false,"approved":true,"locale":"ja","invite_request":null,"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]}},"assigned_account":null,"action_taken_by_account":null,"statuses":[{"id":"102317184522339970","created_at":"2019-06-22T20:45:36.102Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/102317184522339970","url":"http://localhost/@mastodonpy_test/102317184522339970","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"content":"\u003cp\u003eToot!\u003c/p\u003e","reblog":null,"application":{"name":"Mastodon.py
337 test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}]}'}
338 headers:
339 Cache-Control: ['no-cache, no-store']
340 Content-Type: [application/json; charset=utf-8]
341 Referrer-Policy: [strict-origin-when-cross-origin]
342 Transfer-Encoding: [chunked]
343 Vary: ['Accept-Encoding, Origin']
344 X-Content-Type-Options: [nosniff]
345 X-Download-Options: [noopen]
346 X-Frame-Options: [SAMEORIGIN]
347 X-Permitted-Cross-Domain-Policies: [none]
348 X-Request-Id: [e1b0cb9f-3525-4821-91bb-fc816475260f]
349 X-Runtime: ['0.074705']
350 X-XSS-Protection: [1; mode=block]
351 content-length: ['3128']
352 status: {code: 200, message: OK}
353- request:
354 body: null
355 headers:
356 Accept: ['*/*']
357 Accept-Encoding: ['gzip, deflate']
358 Authorization: [Bearer __MASTODON_PY_TEST_ACCESS_TOKEN]
359 Connection: [keep-alive]
360 Content-Length: ['0']
361 User-Agent: [python-requests/2.18.4]
362 method: DELETE
363 uri: http://localhost:3000/api/v1/statuses/102317184522339970
364 response:
365 body: {string: '{"id":"102317184522339970","created_at":"2019-06-22T20:45:36.102Z","in_reply_to_id":null,"in_reply_to_account_id":null,"sensitive":false,"spoiler_text":"","visibility":"public","language":"ja","uri":"http://localhost/users/mastodonpy_test/statuses/102317184522339970","url":"http://localhost/@mastodonpy_test/102317184522339970","replies_count":0,"reblogs_count":0,"favourites_count":0,"favourited":false,"reblogged":false,"muted":false,"pinned":false,"text":"Toot!","reblog":null,"application":{"name":"Mastodon.py
366 test suite","website":null},"account":{"id":"1234567890123456","username":"mastodonpy_test","acct":"mastodonpy_test","display_name":"","locked":false,"bot":false,"created_at":"2019-06-22T22:24:48.478Z","note":"\u003cp\u003e\u003c/p\u003e","url":"http://localhost/@mastodonpy_test","avatar":"http://localhost/avatars/original/missing.png","avatar_static":"http://localhost/avatars/original/missing.png","header":"http://localhost/headers/original/missing.png","header_static":"http://localhost/headers/original/missing.png","followers_count":0,"following_count":0,"statuses_count":1,"emojis":[],"fields":[]},"media_attachments":[],"mentions":[],"tags":[],"emojis":[],"card":null,"poll":null}'}
367 headers:
368 Cache-Control: ['no-cache, no-store']
369 Content-Type: [application/json; charset=utf-8]
370 Referrer-Policy: [strict-origin-when-cross-origin]
371 Transfer-Encoding: [chunked]
372 Vary: ['Accept-Encoding, Origin']
373 X-Content-Type-Options: [nosniff]
374 X-Download-Options: [noopen]
375 X-Frame-Options: [SAMEORIGIN]
376 X-Permitted-Cross-Domain-Policies: [none]
377 X-Request-Id: [ded642b0-2e16-449e-9e93-afdf225d2e4b]
378 X-Runtime: ['0.090164']
379 X-XSS-Protection: [1; mode=block]
380 content-length: ['1206']
381 status: {code: 200, message: OK}
382version: 1
diff --git a/tests/test_admin.py b/tests/test_admin.py
index 57e9fb2..4138783 100644
--- a/tests/test_admin.py
+++ b/tests/test_admin.py
@@ -43,4 +43,40 @@ def test_admin_moderation(api, api2):
43 api2.admin_account_unsuspend(account) 43 api2.admin_account_unsuspend(account)
44 api2.admin_account_enable(account) 44 api2.admin_account_enable(account)
45 api2.admin_account_unsilence(account) 45 api2.admin_account_unsilence(account)
46 46
47@pytest.mark.vcr()
48def test_admin_reports(api, api2, status):
49 account = api.account_verify_credentials()
50 account2 = api2.account_verify_credentials()
51 report = api2.report(account, status, "api crimes")
52 assert(report)
53 assert(not report.action_taken)
54
55 report_list = api2.admin_reports()
56 assert(report.id in [x.id for x in report_list])
57
58 report = api2.admin_report_resolve(report)
59 report_list = api2.admin_reports()
60 assert(report.action_taken)
61 assert(report.action_taken_by_account.id == account2.id)
62 assert(not report.id in [x.id for x in report_list])
63
64 report = api2.admin_report_reopen(report)
65 report_list = api2.admin_reports()
66 assert(not report.action_taken)
67 assert(report.id in [x.id for x in report_list])
68
69 report = api2.admin_report_assign(report)
70 assert(report.assigned_account.id == account2.id)
71
72 report = api2.admin_report_unassign(report)
73 assert(report.assigned_account is None)
74
75 report2 = api2.admin_report(report)
76 assert(report2)
77 assert(report2.id == report.id)
78
79@pytest.mark.skip(reason="reject / accept of account requests isn't really testable without modifying instance settings. anyone want to fumble those into the DB setup and write this test, please do.")
80def test_admin_accountrequests(api2):
81 pass
82
Powered by cgit v1.2.3 (git 2.41.0)