19 Commits

Author SHA1 Message Date
Felipe Cardoso
b5f1c7ddcb Fixe (partially) gift tests and api 2025-03-16 15:07:31 +01:00
Felipe Cardoso
ed017a42ed Add for gifts: schema, crud, route, tests
All checks were successful
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Successful in 51s
Build and Push Docker Images / build-frontend (push) Has been skipped
2025-03-16 14:23:28 +01:00
Felipe Cardoso
38acdb78a1 Add storage utilities and tests for file handling and tokens
All checks were successful
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Successful in 51s
Build and Push Docker Images / build-frontend (push) Has been skipped
Introduced new fixtures and tests for storage functionality, including saving files, generating URLs, and token creation/verification. Refactored `get_storage_provider` into a separate dependency module. Enhanced test coverage for improved reliability.
2025-03-12 18:50:30 +01:00
Felipe Cardoso
288e09202d Add background and foreground image URLs to event themes
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 50s
Build and Push Docker Images / build-frontend (push) Has been skipped
Extended the event theme schema to include `background_image_url`
2025-03-12 16:20:12 +01:00
Felipe Cardoso
525d1b8012 Add is_active field to EventTheme model and test fixture.
The `is_active` field was introduced to the `EventTheme` model to indicate whether a theme is active. The corresponding test fixture in `conftest.py` was updated to include this new field, ensuring consistency in tests. This change enhances flexibility for managing event themes.
2025-03-12 15:21:28 +01:00
Felipe Cardoso
c5915e57b1 Restrict event access and add extensive event tests
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 51s
Build and Push Docker Images / build-frontend (push) Has been skipped
Updated event API to enforce stricter access controls based on user roles, including creators, managers, superusers, and guests. Added robust test cases for creating, fetching, and handling event access scenarios to ensure consistent behavior across endpoints.
2025-03-09 17:37:48 +01:00
Felipe Cardoso
c2cdc3c110 Refactor event API and extend authentication utilities
All checks were successful
Build and Push Docker Images / changes (push) Successful in 6s
Build and Push Docker Images / build-backend (push) Successful in 55s
Build and Push Docker Images / build-frontend (push) Has been skipped
Refactored the event API routes to improve error handling, add logging, and provide enhanced response structures with pagination. Updated tests to use new fixtures and include additional authentication utilities to facilitate testing with FastAPI's dependency injection. Also resolved issues with timezone awareness in event schemas.
2025-03-09 16:04:51 +01:00
Felipe Cardoso
4a9a37f507 Add CRUD operations and tests for Event model
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 50s
Build and Push Docker Images / build-frontend (push) Has been skipped
This commit introduces a new CRUDEvent class to manage event-related database operations, including retrieval, creation, updating, and deletion of events. It includes corresponding unit tests to ensure the correctness of these functionalities, updates event schemas for enhanced validation, and refines timezone handling for event dates and deadlines.
2025-03-05 14:58:15 +01:00
Felipe Cardoso
b384512b9c Add tests for event theme API functionality
All checks were successful
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Successful in 52s
Build and Push Docker Images / build-frontend (push) Has been skipped
Introduces comprehensive tests for creating, listing, updating, and retrieving event themes. Includes scenarios with valid data, invalid data, and pagination to ensure robust API behavior. Adds necessary fixtures to support the new test cases.
2025-03-05 12:42:06 +01:00
Felipe Cardoso
7d9f4ee4b2 Add CRUD operations for users with tests and fixtures
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 54s
Build and Push Docker Images / build-frontend (push) Has been skipped
Implemented user CRUD operations including creation, retrieval, updating, and deletion through a generic CRUD base class. Enhanced user schemas with additional attributes and created tests to verify functionality, covering edge cases such as duplicates and pagination. Updated the test suite with new fixtures and methods to support the tests.
2025-03-04 18:33:33 +01:00
Felipe Cardoso
cd92cd9780 Remove token revocation logic and unused dependencies
Eliminated the `RevokedToken` model and associated logic for managing token revocation. Removed unused files, related tests, and outdated dependencies in authentication modules. Simplified token decoding, user validation, and dependency injection by streamlining the flow and enhancing maintainability.
2025-03-02 11:04:12 +01:00
Felipe Cardoso
1fd1144bc1 Add and extend test coverage for models and their methods
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 49s
Build and Push Docker Images / build-frontend (push) Has been skipped
Enhanced test coverage includes `repr` methods, model functionality, and validation logic for key models like `GiftItem`, `GiftCategory`, `EventMedia`, `RSVP`, and `GiftPurchase`. Refactored and added fixtures to support comprehensive testing scenarios. Addresses validation for gift reordering and updates `EventMedia` representation format for consistency.
2025-02-28 15:57:32 +01:00
Felipe Cardoso
c15c55d691 Add tests for EmailTemplate and NotificationLog models
Introduced comprehensive unit tests for EmailTemplate and NotificationLog, including creation, field validation, and custom methods. Added relevant test fixtures to support these models and expanded `conftest.py` for reusability. Validates functionality and maintains model integrity.
2025-02-28 15:16:23 +01:00
Felipe Cardoso
b8c7d63d91 Add ActivityLog fixtures and tests for logging activities
Introduce a new pytest fixture for creating ActivityLog entries. Add comprehensive tests to verify ActivityLog creation and logging functionality, including user, event, and guest activities. Ensure proper test coverage for key methods and representations.
2025-02-28 15:06:50 +01:00
Felipe Cardoso
d442182ed0 Add tests for Guest model and corresponding fixtures
Introduce unit tests for the Guest model covering properties, methods, and behaviors such as creation, status updates, and permissions. Add `guest_fixture` in `conftest.py` to streamline reusable test setup for Guest instances.
2025-02-28 15:01:13 +01:00
Felipe Cardoso
0bbd74ff50 Add tests and fixture for EventTheme model
Introduce a new pytest fixture for creating EventTheme instances and add comprehensive unit tests covering its properties, relationships, and behaviors. These changes improve test coverage and ensure the EventTheme model functions as expected.
2025-02-28 14:59:35 +01:00
Felipe Cardoso
97155f4b6b Add validation for display_order and EventMedia tests
Introduce a `validate_display_order` method to ensure a default value of 0 for `display_order`. Extend testing infrastructure with fixtures and unit tests for `EventMedia` to validate properties, metadata, and default behaviors.
2025-02-28 14:55:59 +01:00
Felipe Cardoso
180c4c2c09 Add tests for Event model and new mock_user fixture
All checks were successful
Build and Push Docker Images / changes (push) Successful in 5s
Build and Push Docker Images / build-backend (push) Successful in 51s
Build and Push Docker Images / build-frontend (push) Has been skipped
Introduce comprehensive tests for the Event model, covering creation, updates, deletions, relationships, defaults, and constraints. Added the `mock_user` fixture to streamline user-related test setups and ensure proper linkage between users and events. Improves test coverage and ensures model behavior consistency.
2025-02-28 14:25:00 +01:00
Felipe Cardoso
1d51e2ad20 Add pytest fixture for database session in tests
Introduce a `db_session` pytest fixture to provide a fresh SQLite in-memory database for each test function. This ensures isolated and consistent database state across tests by setting up and tearing down the database automatically.
2025-02-28 14:19:39 +01:00