@@ 1259-1299 (lines=41) @@ | ||
1256 | assert revision['author']['avatar_url'] is None |
|
1257 | assert revision['author']['public_name'] == 'Bob i.' |
|
1258 | ||
1259 | def test_api__set_html_document_status__ok_200__nominal_case(self) -> None: |
|
1260 | """ |
|
1261 | Get one html document of a content |
|
1262 | """ |
|
1263 | self.testapp.authorization = ( |
|
1264 | 'Basic', |
|
1265 | ( |
|
1266 | '[email protected]', |
|
1267 | '[email protected]' |
|
1268 | ) |
|
1269 | ) |
|
1270 | params = { |
|
1271 | 'status': 'closed-deprecated', |
|
1272 | } |
|
1273 | ||
1274 | # before |
|
1275 | res = self.testapp.get( |
|
1276 | '/api/v2/workspaces/2/html-documents/6', |
|
1277 | status=200 |
|
1278 | ) |
|
1279 | content = res.json_body |
|
1280 | assert content['content_type'] == 'html-document' |
|
1281 | assert content['content_id'] == 6 |
|
1282 | assert content['status'] == 'open' |
|
1283 | ||
1284 | # set status |
|
1285 | self.testapp.put_json( |
|
1286 | '/api/v2/workspaces/2/html-documents/6/status', |
|
1287 | params=params, |
|
1288 | status=204 |
|
1289 | ) |
|
1290 | ||
1291 | # after |
|
1292 | res = self.testapp.get( |
|
1293 | '/api/v2/workspaces/2/html-documents/6', |
|
1294 | status=200 |
|
1295 | ) |
|
1296 | content = res.json_body |
|
1297 | assert content['content_type'] == 'html-document' |
|
1298 | assert content['content_id'] == 6 |
|
1299 | assert content['status'] == 'closed-deprecated' |
|
1300 | ||
1301 | def test_api__set_html_document_status__err_400__wrong_status(self) -> None: |
|
1302 | """ |
|
@@ 4020-4060 (lines=41) @@ | ||
4017 | revision = revisions[4] |
|
4018 | revision['revision_type'] == 'undeletion' |
|
4019 | ||
4020 | def test_api__set_thread_status__ok_200__nominal_case(self) -> None: |
|
4021 | """ |
|
4022 | Set thread status |
|
4023 | """ |
|
4024 | self.testapp.authorization = ( |
|
4025 | 'Basic', |
|
4026 | ( |
|
4027 | '[email protected]', |
|
4028 | '[email protected]' |
|
4029 | ) |
|
4030 | ) |
|
4031 | params = { |
|
4032 | 'status': 'closed-deprecated', |
|
4033 | } |
|
4034 | ||
4035 | # before |
|
4036 | res = self.testapp.get( |
|
4037 | '/api/v2/workspaces/2/threads/7', |
|
4038 | status=200 |
|
4039 | ) # nopep8 |
|
4040 | content = res.json_body |
|
4041 | assert content['content_type'] == 'thread' |
|
4042 | assert content['content_id'] == 7 |
|
4043 | assert content['status'] == 'open' |
|
4044 | ||
4045 | # set status |
|
4046 | self.testapp.put_json( |
|
4047 | '/api/v2/workspaces/2/threads/7/status', |
|
4048 | params=params, |
|
4049 | status=204 |
|
4050 | ) |
|
4051 | ||
4052 | # after |
|
4053 | res = self.testapp.get( |
|
4054 | '/api/v2/workspaces/2/threads/7', |
|
4055 | status=200 |
|
4056 | ) # nopep8 |
|
4057 | content = res.json_body |
|
4058 | assert content['content_type'] == 'thread' |
|
4059 | assert content['content_id'] == 7 |
|
4060 | assert content['status'] == 'closed-deprecated' |
|
4061 | ||
4062 | def test_api__set_thread_status__ok_400__wrong_status(self) -> None: |
|
4063 | """ |