Skip to content

Conversation

@elof-dev
Copy link

Summary

This pull request fixes **Issue #6 ** — club points were not being updated after a booking

Context

Previously, when a club booked places, the number of competition places was updated but the club's own points remained unchanged.

Changes Made

  • server.py → added club['points'] = club_points - placesRequired in purchasePlaces()
  • tests/test_booking_decrease_club_points.py → new test file to confirm that:
    • club points decrease correctly after a valid booking

Testing

  • 1 test created and passed with pytest
  • Verified status code, message and number of points remaining in the browser

Linked Issue

Fix #6

- 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
- Updated book() to avoid clubs booking in past competition
- Added a new test file with 2 unit tests
- Added missing line in purchasePlaces() to decrease club points after a valid booking
- Created test to verify:
  - club points decrease when booking succeeds
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: Point updates are not reflected

1 participant