"""Tests for PostLike domain entity. This module tests the PostLike entity creation, attributes, and BaseEntity integration. """ from uuid import UUID from app.domain.entities.like import PostLike class TestPostLikeEntity: """Tests for the PostLike domain entity. Covers TC-UNIT-826: PostLike entity valid creation. """ def test_post_like_creation(self) -> None: """Test creating a PostLike with valid attributes. TC-UNIT-826: Positive — create PostLike instance. Expected: - post_id matches input - liked_by matches input - id is a valid UUID - created_at is set """ post_id = UUID("00000000-0000-0000-0000-000000000001") liked_by = "user-123" like = PostLike(post_id=post_id, liked_by=liked_by) assert like.post_id == post_id assert like.liked_by == liked_by assert isinstance(like.id, UUID) assert like.created_at is not None def test_post_like_to_dict(self) -> None: """Test PostLike to_dict serialization.""" post_id = UUID("00000000-0000-0000-0000-000000000001") liked_by = "device-abc-123" like = PostLike(post_id=post_id, liked_by=liked_by) data = like.to_dict() assert data["post_id"] == str(post_id) assert data["liked_by"] == liked_by assert "id" in data assert "created_at" in data