From 185744ff7bcf04b9e5c3ab178d88e8d1cbdf6795 Mon Sep 17 00:00:00 2001 From: yann Date: Mon, 7 Jul 2025 11:06:55 +0200 Subject: [PATCH] added test for multiple book --- tests/test_purchase.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_purchase.py b/tests/test_purchase.py index 8fbe211..ae7257c 100644 --- a/tests/test_purchase.py +++ b/tests/test_purchase.py @@ -21,8 +21,18 @@ class TestPoints: class TestPlaces: - def test_should_refuse_more_than_12(self, client, club1): + def test_should_refuse_more_than_12_once(self, client, club1): club1.update({"places": 13}) response = client.post('/purchasePlaces', data=club1) soup = BeautifulSoup(response.data, "html.parser") assert "You can't book more than 12 places" == soup.li.text + + def test_should_refuse_more_12_total(self, client, club1): + club1.update({"places": 2}) + response = client.post('/purchasePlaces', data=club1) + soup = BeautifulSoup(response.data, "html.parser") + assert "Great ! 2 places booked for "+club1['competition'] == soup.li.text + club1.update({"places": 12}) + response = client.post('/purchasePlaces', data=club1) + soup = BeautifulSoup(response.data, "html.parser") + assert "You already booked 12 places for "+club1['competition'] == soup.li.text