@@ -0,0 +1,1476 @@
+%22%22%22%0A:Copyright: 2006-2019 Jochen Kupperschmidt%0A:License: Modified BSD, see LICENSE for details.%0A%22%22%22%0A%0Aimport pytest%0A%0Afrom byceps.services.tourney import match_comment_service, match_service%0A%0A%0Adef test_view_for_match_as_json(api_client, api_client_authz_header, match, comment):%0A    url = f'/api/tourney/matches/%7Bmatch.id%7D/comments.json'%0A    headers = %5Bapi_client_authz_header%5D%0A%0A    response = api_client.get(url, headers=headers)%0A    assert response.status_code == 200%0A    assert response.content_type == 'application/json'%0A    assert response.get_json() == %7B%0A        'comments': %5B%0A            %7B%0A                'comment_id': str(comment.id),%0A                'match_id': str(comment.match_id),%0A                'created_at': comment.created_at.isoformat(),%0A                'creator': %7B%0A                    'user_id': str(comment.creator.id),%0A                    'screen_name': comment.creator.screen_name,%0A                    'suspended': False,%0A                    'deleted': False,%0A                    'avatar_url': None,%0A                    'is_orga': False,%0A                %7D,%0A                'body': 'Denn man tau.',%0A                'hidden': False,%0A                'hidden_at': None,%0A                'hidden_by_id': None,%0A            %7D,%0A        %5D,%0A    %7D%0A%0A%0A# helpers%0A%0A%0A@pytest.fixture%0Adef match(app):%0A    return match_service.create_match()%0A%0A%0A@pytest.fixture%0Adef comment(app, match, user):%0A   return match_comment_service.create_comment(match.id, user.id, 'Denn man tau.')%0A

Test tourney match comments retrieval as JSON