Compare commits
15 Commits
bug/issue4
...
c43795515b
| Author | SHA1 | Date | |
|---|---|---|---|
| c43795515b | |||
| 5411980f7e | |||
| 798a9a0d91 | |||
| f79c92e8c3 | |||
| 4565f2a16a | |||
| fe4e2143a7 | |||
| 79a6b00401 | |||
| 0370de60e0 | |||
| 813b7849fe | |||
| 9705789809 | |||
| b34382c46c | |||
| 90cae5ffc9 | |||
| 40226a45a6 | |||
| 1009ebfc1e | |||
| d3e9eda937 |
3
Pipfile
3
Pipfile
@@ -12,6 +12,9 @@ markupsafe = "==1.1.1"
|
|||||||
werkzeug = "==1.0.1"
|
werkzeug = "==1.0.1"
|
||||||
coverage = "*"
|
coverage = "*"
|
||||||
pytest-cov = "*"
|
pytest-cov = "*"
|
||||||
|
pytest = "*"
|
||||||
|
pytest-flask = "*"
|
||||||
|
bs4 = "*"
|
||||||
|
|
||||||
[dev-packages]
|
[dev-packages]
|
||||||
|
|
||||||
|
|||||||
41
Pipfile.lock
generated
41
Pipfile.lock
generated
@@ -17,6 +17,22 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"default": {
|
"default": {
|
||||||
|
"beautifulsoup4": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:9bbbb14bfde9d79f38b8cd5f8c7c85f4b8f2523190ebed90e950a8dea4cb1c4b",
|
||||||
|
"sha256:dbb3c4e1ceae6aefebdaf2423247260cd062430a410e38c66f2baa50a8437195"
|
||||||
|
],
|
||||||
|
"markers": "python_full_version >= '3.7.0'",
|
||||||
|
"version": "==4.13.4"
|
||||||
|
},
|
||||||
|
"bs4": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:a48685c58f50fe127722417bae83fe6badf500d54b55f7e39ffe43b798653925",
|
||||||
|
"sha256:abf8742c0805ef7f662dce4b51cca104cffe52b835238afc169142ab9b3fbccc"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==0.0.2"
|
||||||
|
},
|
||||||
"click": {
|
"click": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a",
|
"sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a",
|
||||||
@@ -238,6 +254,31 @@
|
|||||||
"markers": "python_version >= '3.9'",
|
"markers": "python_version >= '3.9'",
|
||||||
"version": "==6.2.1"
|
"version": "==6.2.1"
|
||||||
},
|
},
|
||||||
|
"pytest-flask": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:58be1c97b21ba3c4d47e0a7691eb41007748506c36bf51004f78df10691fa95e",
|
||||||
|
"sha256:c0e36e6b0fddc3b91c4362661db83fa694d1feb91fa505475be6732b5bc8c253"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"markers": "python_version >= '3.7'",
|
||||||
|
"version": "==1.3.0"
|
||||||
|
},
|
||||||
|
"soupsieve": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:6e60cc5c1ffaf1cebcc12e8188320b72071e922c2e897f737cadce79ad5d30c4",
|
||||||
|
"sha256:ad282f9b6926286d2ead4750552c8a6142bc4c783fd66b0293547c8fe6ae126a"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.8'",
|
||||||
|
"version": "==2.7"
|
||||||
|
},
|
||||||
|
"typing-extensions": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:8676b788e32f02ab42d9e7c61324048ae4c6d844a399eebace3d4979d75ceef4",
|
||||||
|
"sha256:a1514509136dd0b477638fc68d6a91497af5076466ad0fa6c338e44e359944af"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.9'",
|
||||||
|
"version": "==4.14.0"
|
||||||
|
},
|
||||||
"werkzeug": {
|
"werkzeug": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:2de2a5db0baeae7b2d2664949077c2ac63fbd16d98da0ff71837f7d1dea3fd43",
|
"sha256:2de2a5db0baeae7b2d2664949077c2ac63fbd16d98da0ff71837f7d1dea3fd43",
|
||||||
|
|||||||
11
server.py
11
server.py
@@ -26,11 +26,12 @@ def index():
|
|||||||
|
|
||||||
@app.route('/showSummary',methods=['POST'])
|
@app.route('/showSummary',methods=['POST'])
|
||||||
def showSummary():
|
def showSummary():
|
||||||
club = [club for club in clubs if club['email'] == request.form['email']]
|
try:
|
||||||
if club:
|
club = [club for club in clubs if club['email'] == request.form['email']][0]
|
||||||
return render_template('welcome.html', club=club[0], competitions=competitions)
|
return render_template('welcome.html', club=club, competitions=competitions)
|
||||||
flash("Sorry, that email wasn't found")
|
except IndexError:
|
||||||
return redirect(url_for('index'))
|
flash("Sorry, that email wasn't found")
|
||||||
|
return redirect(url_for('index'))
|
||||||
|
|
||||||
@app.route('/book/<competition>/<club>')
|
@app.route('/book/<competition>/<club>')
|
||||||
def book(competition,club):
|
def book(competition,club):
|
||||||
|
|||||||
@@ -20,4 +20,3 @@ def test_shoul_display_page_on_known_email(client):
|
|||||||
soup = BeautifulSoup(response.data, 'html.parser')
|
soup = BeautifulSoup(response.data, 'html.parser')
|
||||||
assert soup.h2.text == "Welcome, "+email
|
assert soup.h2.text == "Welcome, "+email
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,3 +36,4 @@ class TestPlaces:
|
|||||||
response = client.post('/purchasePlaces', data=club1)
|
response = client.post('/purchasePlaces', data=club1)
|
||||||
soup = BeautifulSoup(response.data, "html.parser")
|
soup = BeautifulSoup(response.data, "html.parser")
|
||||||
assert "You already booked 12 places for "+club1['competition'] == soup.li.text
|
assert "You already booked 12 places for "+club1['competition'] == soup.li.text
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user