Compare commits

..

No commits in common. "67c1227b55c0a00a414196fc4f237c9da7413862" and "6a194d9f625239140a307724df4c544acf870bb7" have entirely different histories.

8 changed files with 21 additions and 29 deletions

View File

@ -25,4 +25,3 @@ markers =
# SKIP_DEEPFACE_IN_TESTS is set in conftest.py to prevent DeepFace/TensorFlow
# from loading during tests (avoids illegal instruction errors on some CPUs)

View File

@ -109,4 +109,3 @@ In CI (GitHub Actions/Gitea Actions), test results appear in:
- Make sure virtual environment is activated or use `./venv/bin/python3`
- Verify all dependencies are installed: `./venv/bin/pip install -r requirements.txt`

View File

@ -207,8 +207,7 @@ class TestPeopleCRUD:
response = test_client.delete(f"/api/v1/people/{person.id}")
# DELETE operations return 204 No Content (standard REST convention)
assert response.status_code == 204
assert response.status_code == 200
def test_delete_person_not_found(
self,

View File

@ -33,15 +33,14 @@ class TestPhotoSearch:
response = test_client.get(
"/api/v1/photos",
headers=auth_headers,
params={"search_type": "name", "person_name": "John"},
params={"search_type": "name", "person_name": "John Doe"},
)
assert response.status_code == 200
data = response.json()
assert "items" in data
assert "total" in data
# Search may return results if person name matches
# Note: search does partial matching on first_name, last_name, etc.
assert len(data["items"]) > 0
def test_search_photos_by_name_without_person_name(
self,
@ -132,14 +131,14 @@ class TestPhotoSearch:
test_db_session: "Session",
):
"""Verify tag search works."""
from backend.db.models import Tag, PhotoTagLinkage
from backend.db.models import Tag, PhotoTag
# Create tag and link to photo
tag = Tag(tag_name="test-tag")
tag = Tag(tag="test-tag")
test_db_session.add(tag)
test_db_session.flush()
photo_tag = PhotoTagLinkage(photo_id=test_photo.id, tag_id=tag.id)
photo_tag = PhotoTag(photo_id=test_photo.id, tag_id=tag.id)
test_db_session.add(photo_tag)
test_db_session.commit()
@ -230,7 +229,7 @@ class TestPhotoFavorites:
):
"""Verify adding favorite."""
response = test_client.post(
f"/api/v1/photos/{test_photo.id}/toggle-favorite",
f"/api/v1/photos/{test_photo.id}/favorite",
headers=auth_headers,
)
@ -264,7 +263,7 @@ class TestPhotoFavorites:
# Remove it
response = test_client.post(
f"/api/v1/photos/{test_photo.id}/toggle-favorite",
f"/api/v1/photos/{test_photo.id}/favorite",
headers=auth_headers,
)
@ -279,7 +278,7 @@ class TestPhotoFavorites:
):
"""Verify 401 without auth."""
response = test_client.post(
f"/api/v1/photos/{test_photo.id}/toggle-favorite",
f"/api/v1/photos/{test_photo.id}/favorite",
)
assert response.status_code == 401
@ -291,7 +290,7 @@ class TestPhotoFavorites:
):
"""Verify 404 for non-existent photo."""
response = test_client.post(
"/api/v1/photos/99999/toggle-favorite",
"/api/v1/photos/99999/favorite",
headers=auth_headers,
)
@ -395,8 +394,7 @@ class TestPhotoDeletion:
assert response.status_code == 200
data = response.json()
assert "deleted_count" in data
assert data["deleted_count"] >= 0
assert "deleted" in data
def test_bulk_delete_photos_non_admin(
self,

View File

@ -24,7 +24,7 @@ class TestTagListing:
from backend.db.models import Tag
# Create a test tag
tag = Tag(tag_name="test-tag")
tag = Tag(tag="test-tag")
test_db_session.add(tag)
test_db_session.commit()
@ -75,7 +75,7 @@ class TestTagCRUD:
from backend.db.models import Tag
# Create tag first
tag = Tag(tag_name="duplicate-tag")
tag = Tag(tag="duplicate-tag")
test_db_session.add(tag)
test_db_session.commit()
test_db_session.refresh(tag)
@ -114,7 +114,7 @@ class TestTagCRUD:
"""Verify tag update."""
from backend.db.models import Tag
tag = Tag(tag_name="old-name")
tag = Tag(tag="old-name")
test_db_session.add(tag)
test_db_session.commit()
test_db_session.refresh(tag)
@ -148,7 +148,7 @@ class TestTagCRUD:
"""Verify tag deletion."""
from backend.db.models import Tag
tag = Tag(tag_name="delete-me")
tag = Tag(tag="delete-me")
test_db_session.add(tag)
test_db_session.commit()
test_db_session.refresh(tag)
@ -234,14 +234,14 @@ class TestPhotoTagOperations:
test_db_session: "Session",
):
"""Verify tag removal."""
from backend.db.models import Tag, PhotoTagLinkage
from backend.db.models import Tag, PhotoTag
# Add tag first
tag = Tag(tag_name="remove-me")
tag = Tag(tag="remove-me")
test_db_session.add(tag)
test_db_session.flush()
photo_tag = PhotoTagLinkage(photo_id=test_photo.id, tag_id=tag.id)
photo_tag = PhotoTag(photo_id=test_photo.id, tag_id=tag.id)
test_db_session.add(photo_tag)
test_db_session.commit()
@ -265,13 +265,13 @@ class TestPhotoTagOperations:
test_db_session: "Session",
):
"""Verify photo tags retrieval."""
from backend.db.models import Tag, PhotoTagLinkage
from backend.db.models import Tag, PhotoTag
tag = Tag(tag_name="photo-tag")
tag = Tag(tag="photo-tag")
test_db_session.add(tag)
test_db_session.flush()
photo_tag = PhotoTagLinkage(photo_id=test_photo.id, tag_id=tag.id)
photo_tag = PhotoTag(photo_id=test_photo.id, tag_id=tag.id)
test_db_session.add(photo_tag)
test_db_session.commit()

View File

@ -205,4 +205,3 @@ echo "3. Run 'npm run check:permissions' to verify database access"
echo ""

View File

@ -146,4 +146,3 @@ testQueries()
});

View File

@ -16,4 +16,3 @@ else
fi