Completed
Push — main ( 998805...9204bb )
by Jochen
03:26
created

test_ticket_index()   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 4
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
"""
2
:Copyright: 2006-2020 Jochen Kupperschmidt
3
:License: Modified BSD, see LICENSE for details.
4
"""
5
6
from tests.helpers import http_client
7
8
9
def test_ticket_index(admin_app, party, ticketing_admin, ticket):
10
    url = f'/admin/ticketing/tickets/for_party/{party.id}'
11
    response = get_resource(admin_app, ticketing_admin, url)
12
    assert response.status_code == 200
13
14
15
def test_ticket_view(admin_app, ticketing_admin, ticket):
16
    url = f'/admin/ticketing/tickets/{ticket.id}'
17
    response = get_resource(admin_app, ticketing_admin, url)
18
    assert response.status_code == 200
19
20
21
def test_appoint_user_form(admin_app, ticketing_admin, ticket):
22
    url = f'/admin/ticketing/tickets/{ticket.id}/appoint_user'
23
    response = get_resource(admin_app, ticketing_admin, url)
24
    assert response.status_code == 200
25
26
27
def test_bundle_index(admin_app, party, ticketing_admin, bundle):
28
    url = f'/admin/ticketing/bundles/for_party/{party.id}'
29
    response = get_resource(admin_app, ticketing_admin, url)
30
    assert response.status_code == 200
31
32
33
def test_bundle_view(admin_app, ticketing_admin, bundle):
34
    url = f'/admin/ticketing/bundles/{bundle.id}'
35
    response = get_resource(admin_app, ticketing_admin, url)
36
    assert response.status_code == 200
37
38
39
# helpers
40
41
42
def get_resource(app, user, url):
43
    with http_client(app, user_id=user.id) as client:
44
        return client.get(url)
45