問題
src/example/comment/repository.py の InMemoryCommentRepository.find_all_by_note() にソートがなく、SqlAlchemyCommentRepository の ORDER BY id と挙動が異なる。
# InMemory — ソートなし
items = [c for c in self._store.values() if c.note_id == note_id]
return items[offset : offset + limit]
# SQLAlchemy — ORDER BY id あり
"SELECT ... WHERE note_id = :note_id ORDER BY id LIMIT :limit OFFSET :offset"
削除・再挿入後のページネーション順序が不定になりテスト不一致を引き起こす。
修正方針
sorted(items, key=lambda c: c.id) を追加する。
問題
src/example/comment/repository.pyのInMemoryCommentRepository.find_all_by_note()にソートがなく、SqlAlchemyCommentRepositoryのORDER BY idと挙動が異なる。削除・再挿入後のページネーション順序が不定になりテスト不一致を引き起こす。
修正方針
sorted(items, key=lambda c: c.id)を追加する。