Conditions | 1 |
Total Lines | 25 |
Code Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | """ |
||
11 | def test_view_for_match_as_json(api_client, api_client_authz_header, match, comment): |
||
12 | url = f'/api/tourney/matches/{match.id}/comments.json' |
||
13 | headers = [api_client_authz_header] |
||
14 | |||
15 | response = api_client.get(url, headers=headers) |
||
16 | assert response.status_code == 200 |
||
17 | assert response.content_type == 'application/json' |
||
18 | assert response.get_json() == { |
||
19 | 'comments': [ |
||
20 | { |
||
21 | 'comment_id': str(comment.id), |
||
22 | 'match_id': str(comment.match_id), |
||
23 | 'created_at': comment.created_at.isoformat(), |
||
24 | 'creator': { |
||
25 | 'user_id': str(comment.creator.id), |
||
26 | 'screen_name': comment.creator.screen_name, |
||
27 | 'suspended': False, |
||
28 | 'deleted': False, |
||
29 | 'avatar_url': None, |
||
30 | 'is_orga': False, |
||
31 | }, |
||
32 | 'body': 'Denn man tau.', |
||
33 | 'hidden': False, |
||
34 | 'hidden_at': None, |
||
35 | 'hidden_by_id': None, |
||
36 | }, |
||
52 |