|
|
|
|
94
|
assert len(res.json_body) == 4
|
94
|
assert len(res.json_body) == 4
|
95
|
assert comment == res.json_body[3]
|
95
|
assert comment == res.json_body[3]
|
96
|
|
96
|
|
97
|
- def test_api__delete_content_comment__ok_200__workspace_manager_owner(self) -> None:
|
|
|
|
|
97
|
+ def test_api__delete_content_comment__ok_200__user_is_owner_and_workspace_manager(self) -> None: # nopep8
|
98
|
"""
|
98
|
"""
|
99
|
delete comment (user is workspace_manager and owner)
|
99
|
delete comment (user is workspace_manager and owner)
|
100
|
"""
|
100
|
"""
|
|
|
|
|
127
|
assert len(res.json_body) == 2
|
127
|
assert len(res.json_body) == 2
|
128
|
assert not [content for content in res.json_body if content['content_id'] == 18] # nopep8
|
128
|
assert not [content for content in res.json_body if content['content_id'] == 18] # nopep8
|
129
|
|
129
|
|
130
|
- def test_api__delete_content_comment__ok_200__workspace_manager(self) -> None:
|
|
|
|
|
130
|
+ def test_api__delete_content_comment__ok_200__user_is_workspace_manager(self) -> None: # nopep8
|
131
|
"""
|
131
|
"""
|
132
|
delete comment (user is workspace_manager)
|
132
|
delete comment (user is workspace_manager)
|
133
|
"""
|
133
|
"""
|
|
|
|
|
160
|
assert len(res.json_body) == 2
|
160
|
assert len(res.json_body) == 2
|
161
|
assert not [content for content in res.json_body if content['content_id'] == 19] # nopep8
|
161
|
assert not [content for content in res.json_body if content['content_id'] == 19] # nopep8
|
162
|
|
162
|
|
163
|
- def test_api__delete_content_comment__ok_200__content_manager_owner(self) -> None:
|
|
|
|
|
163
|
+ def test_api__delete_content_comment__ok_200__user_is_owner_and_content_manager(self) -> None: # nopep8
|
164
|
"""
|
164
|
"""
|
165
|
delete comment (user is content-manager and owner)
|
165
|
delete comment (user is content-manager and owner)
|
166
|
"""
|
166
|
"""
|
|
|
|
|
193
|
assert len(res.json_body) == 2
|
193
|
assert len(res.json_body) == 2
|
194
|
assert not [content for content in res.json_body if content['content_id'] == 19] # nopep8
|
194
|
assert not [content for content in res.json_body if content['content_id'] == 19] # nopep8
|
195
|
|
195
|
|
196
|
- def test_api__delete_content_comment__err_403__content_manager(self) -> None:
|
|
|
|
|
196
|
+ def test_api__delete_content_comment__err_403__user_is_content_manager(self) -> None: # nopep8
|
197
|
"""
|
197
|
"""
|
198
|
delete comment (user is content-manager)
|
198
|
delete comment (user is content-manager)
|
199
|
"""
|
199
|
"""
|
|
|
|
|
204
|
'foobarbaz'
|
204
|
'foobarbaz'
|
205
|
)
|
205
|
)
|
206
|
)
|
206
|
)
|
207
|
- res = self.testapp.get('/api/v2/workspaces/2/contents/7/comments', status=200)
|
|
|
|
|
207
|
+ res = self.testapp.get('/api/v2/workspaces/2/contents/7/comments', status=200) # nopep8
|
208
|
assert len(res.json_body) == 3
|
208
|
assert len(res.json_body) == 3
|
209
|
comment = res.json_body[2]
|
209
|
comment = res.json_body[2]
|
210
|
assert comment['content_id'] == 20
|
210
|
assert comment['content_id'] == 20
|
|
|
|
|
223
|
status=403
|
223
|
status=403
|
224
|
)
|
224
|
)
|
225
|
|
225
|
|
226
|
- def test_api__delete_content_comment__err_403__reader_owner(self) -> None:
|
|
|
|
|
226
|
+ def test_api__delete_content_comment__err_403__user_is_owner_and_reader(self) -> None:
|
227
|
"""
|
227
|
"""
|
228
|
delete comment (user is reader and owner)
|
228
|
delete comment (user is reader and owner)
|
229
|
"""
|
229
|
"""
|
|
|
|
|
253
|
status=403
|
253
|
status=403
|
254
|
)
|
254
|
)
|
255
|
|
255
|
|
256
|
- def test_api__delete_content_comment__err_403__reader(self) -> None:
|
|
|
|
|
256
|
+ def test_api__delete_content_comment__err_403__user_is_reader(self) -> None:
|
257
|
"""
|
257
|
"""
|
258
|
delete comment (user is reader)
|
258
|
delete comment (user is reader)
|
259
|
"""
|
259
|
"""
|