Replace anchor_id=None with {block_type}-{position} in test seeds #125

Merged
forgejo_admin merged 1 commit from 123-test-seed-anchor-ids into main 2026-03-09 03:36:14 +00:00

Summary

Test seed helpers created Block objects with anchor_id=None for non-heading blocks, which no longer reflects production behavior where all blocks receive anchor_ids. This PR replaces all 5 occurrences with the {block_type}-{position} convention.

Changes

  • tests/test_blocks_api.py: Updated 3 Block seed objects in _seed_note_with_blocks() and _seed_hierarchical_note() helpers -- anchor_id=None replaced with "paragraph-1", "paragraph-3", and "paragraph-2" respectively
  • tests/test_compiled_page_api.py: Updated 2 Block seed objects in _seed_note_with_compiled_page() helper -- anchor_id=None replaced with "paragraph-1" and "paragraph-3"

Test Plan

  • rg "anchor_id=None" tests/ returns zero results for Block creation
  • All 47 tests across both files pass (pytest tests/test_blocks_api.py tests/test_compiled_page_api.py -v)
  • ruff lint passes on both files

Review Checklist

  • Passed automated review-fix loop
  • No secrets committed
  • No unnecessary file changes
  • Commit messages are descriptive
  • Closes forgejo_admin/pal-e-docs#123 -- the Forgejo issue this PR addresses
  • todo-test-seed-anchor-ids -- the traceability note for this work
## Summary Test seed helpers created Block objects with `anchor_id=None` for non-heading blocks, which no longer reflects production behavior where all blocks receive anchor_ids. This PR replaces all 5 occurrences with the `{block_type}-{position}` convention. ## Changes - `tests/test_blocks_api.py`: Updated 3 Block seed objects in `_seed_note_with_blocks()` and `_seed_hierarchical_note()` helpers -- `anchor_id=None` replaced with `"paragraph-1"`, `"paragraph-3"`, and `"paragraph-2"` respectively - `tests/test_compiled_page_api.py`: Updated 2 Block seed objects in `_seed_note_with_compiled_page()` helper -- `anchor_id=None` replaced with `"paragraph-1"` and `"paragraph-3"` ## Test Plan - [x] `rg "anchor_id=None" tests/` returns zero results for Block creation - [x] All 47 tests across both files pass (`pytest tests/test_blocks_api.py tests/test_compiled_page_api.py -v`) - [x] ruff lint passes on both files ## Review Checklist - [x] Passed automated review-fix loop - [x] No secrets committed - [x] No unnecessary file changes - [x] Commit messages are descriptive ## Related - Closes `forgejo_admin/pal-e-docs#123` -- the Forgejo issue this PR addresses - `todo-test-seed-anchor-ids` -- the traceability note for this work
Replace anchor_id=None with {block_type}-{position} in test seed helpers
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
7a395bd547
Test seed Block objects used anchor_id=None for non-heading blocks,
which misrepresents production behavior where all blocks get anchor_ids.
Updated 5 occurrences across test_blocks_api.py and
test_compiled_page_api.py to use the {block_type}-{position} convention.

Closes #123

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
forgejo_admin deleted branch 123-test-seed-anchor-ids 2026-03-09 03:36:14 +00:00
Sign in to join this conversation.
No description provided.