3
3
4
4
def test_purchase_places (client ):
5
5
6
- clubs = loadClubs ()
7
- competitions = loadCompetitions ()
8
-
9
- test_club = clubs [0 ]
10
- test_competition = competitions [0 ]
6
+ test_club = loadClubs ()[0 ]
7
+ test_competition = loadCompetitions ()[0 ]
11
8
places_to_purchase = 8
12
9
13
10
response = client .post ('/purchasePlaces' , data = {
@@ -22,11 +19,8 @@ def test_purchase_places(client):
22
19
23
20
def test_max_purchase_places (client ):
24
21
25
- clubs = loadClubs ()
26
- competitions = loadCompetitions ()
27
-
28
- test_club = clubs [0 ]
29
- test_competition = competitions [0 ]
22
+ test_club = loadClubs ()[0 ]
23
+ test_competition = loadCompetitions ()[0 ]
30
24
places_to_purchase = 28
31
25
32
26
response = client .post ('/purchasePlaces' , data = {
@@ -37,3 +31,19 @@ def test_max_purchase_places(client):
37
31
38
32
assert response .status_code == 200
39
33
assert b'Max purchase 12.' in response .data
34
+
35
+
36
+ def test_has_sufficient_points (client ):
37
+
38
+ test_club = loadClubs ()[1 ]
39
+ test_competition = loadCompetitions ()[0 ]
40
+ places_to_purchase = 9
41
+
42
+ response = client .post ('/purchasePlaces' , data = {
43
+ 'club' : test_club ['name' ],
44
+ 'competition' : test_competition ['name' ],
45
+ 'places' : places_to_purchase
46
+ })
47
+
48
+ assert response .status_code == 200
49
+ assert b'Insufficiant points.' in response .data
0 commit comments