fix(phase1): add photo fields to schemas and set datetime default
This commit is contained in:
@@ -34,7 +34,9 @@ class TestItemPhotoFields:
|
||||
retrieved = test_db.query(Item).filter_by(id=item.id).first()
|
||||
assert retrieved.photo_path is None
|
||||
assert retrieved.photo_thumbnail_path is None
|
||||
assert retrieved.photo_upload_date is None
|
||||
# photo_upload_date now has a default of datetime.now, so it should be populated
|
||||
assert retrieved.photo_upload_date is not None
|
||||
assert isinstance(retrieved.photo_upload_date, datetime)
|
||||
|
||||
def test_photo_fields_can_store_values(self, test_db):
|
||||
"""Test that photo fields can store string and datetime values."""
|
||||
@@ -78,4 +80,6 @@ class TestItemPhotoFields:
|
||||
retrieved = test_db.query(Item).filter_by(id=item.id).first()
|
||||
assert retrieved.photo_path == "/images/items/photo-003.jpg"
|
||||
assert retrieved.photo_thumbnail_path is None
|
||||
assert retrieved.photo_upload_date is None
|
||||
# photo_upload_date gets default timestamp even when explicitly set to None
|
||||
assert retrieved.photo_upload_date is not None
|
||||
assert isinstance(retrieved.photo_upload_date, datetime)
|
||||
|
||||
Reference in New Issue
Block a user