Skip to content

Commit

Permalink
test(units/): test_past_competition.py ok passed
Browse files Browse the repository at this point in the history
  • Loading branch information
Rossignol-h committed Nov 3, 2022
1 parent c449309 commit eb5bf91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def purchase_places():
return render_template('welcome.html', club=club, competitions=competitions, current_date=current_date), 400
competition['numberOfPlaces'] = int(competition['numberOfPlaces'])-placesRequired
flash('Great-booking complete!')
return render_template('welcome.html', club=club, competitions=competitions)
return render_template('welcome.html', club=club, competitions=competitions, current_date=current_date)


# TODO: Add route for points display
Expand Down
7 changes: 5 additions & 2 deletions tests/units/test_past_competition.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import server


def test_purchase_futur_competition(client, mocker, clubs_fixture, competitions_fixture):
"""
GIVEN a connected secretary's club wants to book places a futur competition.
GIVEN a connected secretary's club wants to book places in a futur competition.
date of this competition = "2023-02-05 10:00:00".
WHEN this secretary types: 5 places
THEN an error message displays, with status code:400 BAD REQUEST.
"""
Expand All @@ -17,6 +19,7 @@ def test_purchase_futur_competition(client, mocker, clubs_fixture, competitions_
def test_purchase_past_competition(client, mocker, clubs_fixture, competitions_fixture):
"""
GIVEN a connected secretary's club wants to book places in a past competition.
date of this competition = "2021-05-12 09:00:00".
WHEN this secretary types: 5 places
THEN an error message displays, with status code:400 BAD REQUEST.
"""
Expand All @@ -25,4 +28,4 @@ def test_purchase_past_competition(client, mocker, clubs_fixture, competitions_f
club = clubs_fixture[0]['name']
competition = competitions_fixture[1]['name']
response = client.post('/purchasePlaces', data={'competition': competition, 'club': club, 'places': 5})
assert response.status_code == 400
assert response.status_code == 400

0 comments on commit eb5bf91

Please sign in to comment.