fix(phase1): add photo fields to schemas and set datetime default

This commit is contained in:
2026-04-20 21:49:51 +03:00
parent 6ed88fdb84
commit 92f6977cae
18 changed files with 250 additions and 6 deletions

View File

@@ -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)