Code Duplication    Length = 40-40 lines in 2 locations

backend/tracim_backend/tests/functional/test_contents.py 2 locations

@@ 840-879 (lines=40) @@
837
        assert content['last_modifier']['avatar_url'] is None
838
        assert content['raw_content'] == '<p>To cook a great Tiramisu, you need many ingredients.</p>'  # nopep8
839
840
    def test_api__get_html_document__ok_200__nominal_case(self) -> None:
841
        """
842
        Get one html document of a content
843
        """
844
        self.testapp.authorization = (
845
            'Basic',
846
            (
847
                '[email protected]',
848
                '[email protected]'
849
            )
850
        )
851
        res = self.testapp.get(
852
            '/api/v2/workspaces/2/html-documents/6',
853
            status=200
854
        )
855
        content = res.json_body
856
        assert content['content_type'] == 'html-document'
857
        assert content['content_id'] == 6
858
        assert content['is_archived'] is False
859
        assert content['is_deleted'] is False
860
        assert content['label'] == 'Tiramisu Recipe'
861
        assert content['parent_id'] == 3
862
        assert content['show_in_ui'] is True
863
        assert content['slug'] == 'tiramisu-recipe'
864
        assert content['status'] == 'open'
865
        assert content['workspace_id'] == 2
866
        assert content['current_revision_id'] == 27
867
        # TODO - G.M - 2018-06-173 - check date format
868
        assert content['created']
869
        assert content['author']
870
        assert content['author']['user_id'] == 1
871
        assert content['author']['avatar_url'] is None
872
        assert content['author']['public_name'] == 'Global manager'
873
        # TODO - G.M - 2018-06-173 - check date format
874
        assert content['modified']
875
        assert content['last_modifier'] != content['author']
876
        assert content['last_modifier']['user_id'] == 3
877
        assert content['last_modifier']['public_name'] == 'Bob i.'
878
        assert content['last_modifier']['avatar_url'] is None
879
        assert content['raw_content'] == '<p>To cook a great Tiramisu, you need many ingredients.</p>'  # nopep8
880
881
    def test_api__get_html_document__ok_200__archived_content(self) -> None:
882
        """
@@ 2589-2628 (lines=40) @@
2586
            status=400
2587
        )
2588
2589
    def test_api__get_thread__ok_200__nominal_case(self) -> None:
2590
        """
2591
        Get one html document of a content
2592
        """
2593
        self.testapp.authorization = (
2594
            'Basic',
2595
            (
2596
                '[email protected]',
2597
                '[email protected]'
2598
            )
2599
        )
2600
        res = self.testapp.get(
2601
            '/api/v2/workspaces/2/threads/7',
2602
            status=200
2603
        )   # nopep8
2604
        content = res.json_body
2605
        assert content['content_type'] == 'thread'
2606
        assert content['content_id'] == 7
2607
        assert content['is_archived'] is False
2608
        assert content['is_deleted'] is False
2609
        assert content['label'] == 'Best Cakes?'
2610
        assert content['parent_id'] == 3
2611
        assert content['show_in_ui'] is True
2612
        assert content['slug'] == 'best-cakes'
2613
        assert content['status'] == 'open'
2614
        assert content['workspace_id'] == 2
2615
        assert content['current_revision_id'] == 26
2616
        # TODO - G.M - 2018-06-173 - check date format
2617
        assert content['created']
2618
        assert content['author']
2619
        assert content['author']['user_id'] == 1
2620
        assert content['author']['avatar_url'] is None
2621
        assert content['author']['public_name'] == 'Global manager'
2622
        # TODO - G.M - 2018-06-173 - check date format
2623
        assert content['modified']
2624
        assert content['last_modifier'] != content['author']
2625
        assert content['last_modifier']['user_id'] == 3
2626
        assert content['last_modifier']['public_name'] == 'Bob i.'
2627
        assert content['last_modifier']['avatar_url'] is None
2628
        assert content['raw_content'] == 'What is the best cake?'  # nopep8
2629
2630
2631
    def test_api__get_thread__err_400__content_does_not_exist(self) -> None: