Add and extend test coverage for models and their methods
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.
This commit is contained in:
@@ -46,7 +46,8 @@ class EventMedia(Base, UUIDMixin, TimestampMixin):
|
||||
uploader = relationship("User", foreign_keys=[uploaded_by])
|
||||
|
||||
def __repr__(self):
|
||||
return f"<EventMedia {self.original_filename} ({self.media_type}) for event={self.event_id}>"
|
||||
return f"<EventMedia {self.original_filename} ({self.media_type.value}) for event={self.event_id}>"
|
||||
|
||||
|
||||
@validates('display_order')
|
||||
def validate_display_order(self, key, value):
|
||||
|
||||
Reference in New Issue
Block a user