@@ 897-936 (lines=40) @@ | ||
894 | assert content['last_modifier']['avatar_url'] is None |
|
895 | assert content['raw_content'] == '<p>To cook a great Tiramisu, you need many ingredients.</p>' # nopep8 |
|
896 | ||
897 | def test_api__get_html_document__ok_200__nominal_case(self) -> None: |
|
898 | """ |
|
899 | Get one html document of a content |
|
900 | """ |
|
901 | self.testapp.authorization = ( |
|
902 | 'Basic', |
|
903 | ( |
|
904 | '[email protected]', |
|
905 | '[email protected]' |
|
906 | ) |
|
907 | ) |
|
908 | res = self.testapp.get( |
|
909 | '/api/v2/workspaces/2/html-documents/6', |
|
910 | status=200 |
|
911 | ) |
|
912 | content = res.json_body |
|
913 | assert content['content_type'] == 'html-document' |
|
914 | assert content['content_id'] == 6 |
|
915 | assert content['is_archived'] is False |
|
916 | assert content['is_deleted'] is False |
|
917 | assert content['label'] == 'Tiramisu Recipe' |
|
918 | assert content['parent_id'] == 3 |
|
919 | assert content['show_in_ui'] is True |
|
920 | assert content['slug'] == 'tiramisu-recipe' |
|
921 | assert content['status'] == 'open' |
|
922 | assert content['workspace_id'] == 2 |
|
923 | assert content['current_revision_id'] == 27 |
|
924 | # TODO - G.M - 2018-06-173 - check date format |
|
925 | assert content['created'] |
|
926 | assert content['author'] |
|
927 | assert content['author']['user_id'] == 1 |
|
928 | assert content['author']['avatar_url'] is None |
|
929 | assert content['author']['public_name'] == 'Global manager' |
|
930 | # TODO - G.M - 2018-06-173 - check date format |
|
931 | assert content['modified'] |
|
932 | assert content['last_modifier'] != content['author'] |
|
933 | assert content['last_modifier']['user_id'] == 3 |
|
934 | assert content['last_modifier']['public_name'] == 'Bob i.' |
|
935 | assert content['last_modifier']['avatar_url'] is None |
|
936 | assert content['raw_content'] == '<p>To cook a great Tiramisu, you need many ingredients.</p>' # nopep8 |
|
937 | ||
938 | def test_api__get_html_document__ok_200__archived_content(self) -> None: |
|
939 | """ |
|
@@ 3646-3685 (lines=40) @@ | ||
3643 | status=400 |
|
3644 | ) |
|
3645 | ||
3646 | def test_api__get_thread__ok_200__nominal_case(self) -> None: |
|
3647 | """ |
|
3648 | Get one html document of a content |
|
3649 | """ |
|
3650 | self.testapp.authorization = ( |
|
3651 | 'Basic', |
|
3652 | ( |
|
3653 | '[email protected]', |
|
3654 | '[email protected]' |
|
3655 | ) |
|
3656 | ) |
|
3657 | res = self.testapp.get( |
|
3658 | '/api/v2/workspaces/2/threads/7', |
|
3659 | status=200 |
|
3660 | ) # nopep8 |
|
3661 | content = res.json_body |
|
3662 | assert content['content_type'] == 'thread' |
|
3663 | assert content['content_id'] == 7 |
|
3664 | assert content['is_archived'] is False |
|
3665 | assert content['is_deleted'] is False |
|
3666 | assert content['label'] == 'Best Cakes?' |
|
3667 | assert content['parent_id'] == 3 |
|
3668 | assert content['show_in_ui'] is True |
|
3669 | assert content['slug'] == 'best-cakes' |
|
3670 | assert content['status'] == 'open' |
|
3671 | assert content['workspace_id'] == 2 |
|
3672 | assert content['current_revision_id'] == 26 |
|
3673 | # TODO - G.M - 2018-06-173 - check date format |
|
3674 | assert content['created'] |
|
3675 | assert content['author'] |
|
3676 | assert content['author']['user_id'] == 1 |
|
3677 | assert content['author']['avatar_url'] is None |
|
3678 | assert content['author']['public_name'] == 'Global manager' |
|
3679 | # TODO - G.M - 2018-06-173 - check date format |
|
3680 | assert content['modified'] |
|
3681 | assert content['last_modifier'] != content['author'] |
|
3682 | assert content['last_modifier']['user_id'] == 3 |
|
3683 | assert content['last_modifier']['public_name'] == 'Bob i.' |
|
3684 | assert content['last_modifier']['avatar_url'] is None |
|
3685 | assert content['raw_content'] == 'What is the best cake?' # nopep8 |
|
3686 | ||
3687 | def test_api__get_thread__err_400__content_does_not_exist(self) -> None: |
|
3688 | """ |