@@ 2507-2546 (lines=40) @@ | ||
2504 | status=400 |
|
2505 | ) |
|
2506 | ||
2507 | def test_api__get_thread__ok_200__nominal_case(self) -> None: |
|
2508 | """ |
|
2509 | Get one html document of a content |
|
2510 | """ |
|
2511 | self.testapp.authorization = ( |
|
2512 | 'Basic', |
|
2513 | ( |
|
2514 | '[email protected]', |
|
2515 | '[email protected]' |
|
2516 | ) |
|
2517 | ) |
|
2518 | res = self.testapp.get( |
|
2519 | '/api/v2/workspaces/2/threads/7', |
|
2520 | status=200 |
|
2521 | ) # nopep8 |
|
2522 | content = res.json_body |
|
2523 | assert content['content_type'] == 'thread' |
|
2524 | assert content['content_id'] == 7 |
|
2525 | assert content['is_archived'] is False |
|
2526 | assert content['is_deleted'] is False |
|
2527 | assert content['label'] == 'Best Cakes?' |
|
2528 | assert content['parent_id'] == 3 |
|
2529 | assert content['show_in_ui'] is True |
|
2530 | assert content['slug'] == 'best-cakes' |
|
2531 | assert content['status'] == 'open' |
|
2532 | assert content['workspace_id'] == 2 |
|
2533 | assert content['current_revision_id'] == 26 |
|
2534 | # TODO - G.M - 2018-06-173 - check date format |
|
2535 | assert content['created'] |
|
2536 | assert content['author'] |
|
2537 | assert content['author']['user_id'] == 1 |
|
2538 | assert content['author']['avatar_url'] is None |
|
2539 | assert content['author']['public_name'] == 'Global manager' |
|
2540 | # TODO - G.M - 2018-06-173 - check date format |
|
2541 | assert content['modified'] |
|
2542 | assert content['last_modifier'] != content['author'] |
|
2543 | assert content['last_modifier']['user_id'] == 3 |
|
2544 | assert content['last_modifier']['public_name'] == 'Bob i.' |
|
2545 | assert content['last_modifier']['avatar_url'] is None |
|
2546 | assert content['raw_content'] == 'What is the best cake?' # nopep8 |
|
2547 | ||
2548 | def test_api__get_thread__err_400__content_does_not_exist(self) -> None: |
|
2549 | """ |
|
@@ 839-878 (lines=40) @@ | ||
836 | assert content['last_modifier']['avatar_url'] is None |
|
837 | assert content['raw_content'] == '<p>To cook a great Tiramisu, you need many ingredients.</p>' # nopep8 |
|
838 | ||
839 | def test_api__get_html_document__ok_200__nominal_case(self) -> None: |
|
840 | """ |
|
841 | Get one html document of a content |
|
842 | """ |
|
843 | self.testapp.authorization = ( |
|
844 | 'Basic', |
|
845 | ( |
|
846 | '[email protected]', |
|
847 | '[email protected]' |
|
848 | ) |
|
849 | ) |
|
850 | res = self.testapp.get( |
|
851 | '/api/v2/workspaces/2/html-documents/6', |
|
852 | status=200 |
|
853 | ) |
|
854 | content = res.json_body |
|
855 | assert content['content_type'] == 'html-document' |
|
856 | assert content['content_id'] == 6 |
|
857 | assert content['is_archived'] is False |
|
858 | assert content['is_deleted'] is False |
|
859 | assert content['label'] == 'Tiramisu Recipe' |
|
860 | assert content['parent_id'] == 3 |
|
861 | assert content['show_in_ui'] is True |
|
862 | assert content['slug'] == 'tiramisu-recipe' |
|
863 | assert content['status'] == 'open' |
|
864 | assert content['workspace_id'] == 2 |
|
865 | assert content['current_revision_id'] == 27 |
|
866 | # TODO - G.M - 2018-06-173 - check date format |
|
867 | assert content['created'] |
|
868 | assert content['author'] |
|
869 | assert content['author']['user_id'] == 1 |
|
870 | assert content['author']['avatar_url'] is None |
|
871 | assert content['author']['public_name'] == 'Global manager' |
|
872 | # TODO - G.M - 2018-06-173 - check date format |
|
873 | assert content['modified'] |
|
874 | assert content['last_modifier'] != content['author'] |
|
875 | assert content['last_modifier']['user_id'] == 3 |
|
876 | assert content['last_modifier']['public_name'] == 'Bob i.' |
|
877 | assert content['last_modifier']['avatar_url'] is None |
|
878 | assert content['raw_content'] == '<p>To cook a great Tiramisu, you need many ingredients.</p>' # nopep8 |
|
879 | ||
880 | def test_api__get_html_document__ok_200__archived_content(self) -> None: |
|
881 | """ |