more than 12 test ok
This commit is contained in:
parent
524c4ca028
commit
691392988f
@ -7,10 +7,10 @@
|
|||||||
{
|
{
|
||||||
"name":"Iron Temple",
|
"name":"Iron Temple",
|
||||||
"email": "admin@irontemple.com",
|
"email": "admin@irontemple.com",
|
||||||
"points":"47"
|
"points":"4"
|
||||||
},
|
},
|
||||||
{ "name":"She Lifts",
|
{ "name":"She Lifts",
|
||||||
"email": "kate@shelifts.co.uk",
|
"email": "kate@shelifts.co.uk",
|
||||||
"points":"12"
|
"points":"12"
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
|
@ -53,7 +53,6 @@ def purchasePlaces():
|
|||||||
else:
|
else:
|
||||||
places = {competition['name']: placesRequired}
|
places = {competition['name']: placesRequired}
|
||||||
points = int(club['points'])
|
points = int(club['points'])
|
||||||
print("booked", places)
|
|
||||||
if placesRequired <= 12:
|
if placesRequired <= 12:
|
||||||
if places[competition['name']] <= 12:
|
if places[competition['name']] <= 12:
|
||||||
if placesRequired <= points:
|
if placesRequired <= points:
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif%}
|
{% endif%}
|
||||||
Points available: {{club['points']}}
|
<b id="points">Points available: </b><span>{{club['points']}}</span>
|
||||||
<h3>Competitions:</h3>
|
<h3>Competitions:</h3>
|
||||||
<ul>
|
<ul>
|
||||||
{% for comp in competitions%}
|
{% for comp in competitions%}
|
||||||
|
@ -6,6 +6,7 @@ from bs4 import BeautifulSoup
|
|||||||
EMAIL1 = "admin@irontemple.com"
|
EMAIL1 = "admin@irontemple.com"
|
||||||
EMAIL2 = "john@simplylift.co"
|
EMAIL2 = "john@simplylift.co"
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def club1():
|
def club1():
|
||||||
data = {"competition": "Spring Festival", "club": "Iron Temple"}
|
data = {"competition": "Spring Festival", "club": "Iron Temple"}
|
||||||
@ -27,4 +28,3 @@ def connect(client):
|
|||||||
soup = BeautifulSoup(response.data, 'html.parser')
|
soup = BeautifulSoup(response.data, 'html.parser')
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ class TestPlaces:
|
|||||||
|
|
||||||
def test_should_refuse_more_than_12(self, client, club1):
|
def test_should_refuse_more_than_12(self, client, club1):
|
||||||
club1.update({"places": 13})
|
club1.update({"places": 13})
|
||||||
response = client.post('/puchasePlaces', data=club1)
|
response = client.post('/purchasePlaces', data=club1)
|
||||||
print(response.data)
|
|
||||||
soup = BeautifulSoup(response.data, "html.parser")
|
soup = BeautifulSoup(response.data, "html.parser")
|
||||||
assert "You can't book more than 12 places" == soup.li.text
|
assert "You can't book more than 12 places" == soup.li.text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user