Skip to content

Conversation

@elof-dev
Copy link

Summary

This pull request fixes **Issue #4 ** — clubs are not allowed to book more than 12 places per competition.

Context

The purchasePlaces() function in server.py did not restrict the number of places a club could book
A limit of 12 places per competition is now enforced to to ensure fairness toward other clubs

Changes Made

  • server.py → added a condition in purchasePlaces() to restrict bookings to a maximum of 12 places
  • tests/test_max_booking_limit.py → created a new test file to check purchasePlaces() behaviour when clubs try to book 12 and/or more than 12 places.

Testing

  • 2 tests run successfully using pytest
  • Verified status code, message and number of places remaining in the browser for:
    • booking 12 places
    • booking more than 12 places

Linked Issue

Fix #4

- Updated showSummary() in server.py to handle email validation and error messages
- Modified index.html to display flash messages correctly
- Created tests/ folder with conftest.py and test_show_summary.py for unit testing
- Added .flaskenv for local environment configuration
- Updated .gitignore to include .venv and exclude tests/ folder
- Updated requirements.txt to add pytest dependency
- Updated purchasePlaces() to check if the club has enough points before confirming a booking
- Added a new test file with 2 unit tests to verify point validation logic
- Updated purchasePlaces() to check avoid clubs booking more than 12 places per competition
- Added a new test file with 2 unit tests to verify point validation logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Clubs shouldn't be able to book more than 12 places per competition

1 participant