@@ 1202-1242 (lines=41) @@ | ||
1199 | assert revision['author']['avatar_url'] is None |
|
1200 | assert revision['author']['public_name'] == 'Bob i.' |
|
1201 | ||
1202 | def test_api__set_html_document_status__ok_200__nominal_case(self) -> None: |
|
1203 | """ |
|
1204 | Get one html document of a content |
|
1205 | """ |
|
1206 | self.testapp.authorization = ( |
|
1207 | 'Basic', |
|
1208 | ( |
|
1209 | '[email protected]', |
|
1210 | '[email protected]' |
|
1211 | ) |
|
1212 | ) |
|
1213 | params = { |
|
1214 | 'status': 'closed-deprecated', |
|
1215 | } |
|
1216 | ||
1217 | # before |
|
1218 | res = self.testapp.get( |
|
1219 | '/api/v2/workspaces/2/html-documents/6', |
|
1220 | status=200 |
|
1221 | ) |
|
1222 | content = res.json_body |
|
1223 | assert content['content_type'] == 'html-document' |
|
1224 | assert content['content_id'] == 6 |
|
1225 | assert content['status'] == 'open' |
|
1226 | ||
1227 | # set status |
|
1228 | self.testapp.put_json( |
|
1229 | '/api/v2/workspaces/2/html-documents/6/status', |
|
1230 | params=params, |
|
1231 | status=204 |
|
1232 | ) |
|
1233 | ||
1234 | # after |
|
1235 | res = self.testapp.get( |
|
1236 | '/api/v2/workspaces/2/html-documents/6', |
|
1237 | status=200 |
|
1238 | ) |
|
1239 | content = res.json_body |
|
1240 | assert content['content_type'] == 'html-document' |
|
1241 | assert content['content_id'] == 6 |
|
1242 | assert content['status'] == 'closed-deprecated' |
|
1243 | ||
1244 | def test_api__set_html_document_status__err_400__wrong_status(self) -> None: |
|
1245 | """ |
|
@@ 2964-3004 (lines=41) @@ | ||
2961 | revision = revisions[4] |
|
2962 | revision['revision_type'] == 'undeletion' |
|
2963 | ||
2964 | def test_api__set_thread_status__ok_200__nominal_case(self) -> None: |
|
2965 | """ |
|
2966 | Set thread status |
|
2967 | """ |
|
2968 | self.testapp.authorization = ( |
|
2969 | 'Basic', |
|
2970 | ( |
|
2971 | '[email protected]', |
|
2972 | '[email protected]' |
|
2973 | ) |
|
2974 | ) |
|
2975 | params = { |
|
2976 | 'status': 'closed-deprecated', |
|
2977 | } |
|
2978 | ||
2979 | # before |
|
2980 | res = self.testapp.get( |
|
2981 | '/api/v2/workspaces/2/threads/7', |
|
2982 | status=200 |
|
2983 | ) # nopep8 |
|
2984 | content = res.json_body |
|
2985 | assert content['content_type'] == 'thread' |
|
2986 | assert content['content_id'] == 7 |
|
2987 | assert content['status'] == 'open' |
|
2988 | ||
2989 | # set status |
|
2990 | self.testapp.put_json( |
|
2991 | '/api/v2/workspaces/2/threads/7/status', |
|
2992 | params=params, |
|
2993 | status=204 |
|
2994 | ) |
|
2995 | ||
2996 | # after |
|
2997 | res = self.testapp.get( |
|
2998 | '/api/v2/workspaces/2/threads/7', |
|
2999 | status=200 |
|
3000 | ) # nopep8 |
|
3001 | content = res.json_body |
|
3002 | assert content['content_type'] == 'thread' |
|
3003 | assert content['content_id'] == 7 |
|
3004 | assert content['status'] == 'closed-deprecated' |
|
3005 | ||
3006 | def test_api__set_thread_status__ok_400__wrong_status(self) -> None: |
|
3007 | """ |