Fixed bug where feedgen library was reversing the order of feed items.
Database returns notes in DESC order (newest first), but feedgen was
displaying them oldest-first in the RSS XML. Added reversed() wrapper
to maintain correct chronological order in the feed.
Added regression test to verify feed order matches database order.
Bug confirmed by testing:
- Database: [Note 2, Note 1, Note 0] (newest first)
- Old feed: [Note 0, Note 1, Note 2] (oldest first) ❌
- New feed: [Note 2, Note 1, Note 0] (newest first) ✅🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes:
- Add autouse fixture to clear feed cache between tests
- Fix RSS channel link assertion (feedgen adds feed.xml to links)
- Fix note title test to use minimal valid content
- Fix sample_notes fixture scope issue
All feed tests now pass with proper test isolation.
Adds unit tests for feed module and integration tests for feed route.
test_feed.py:
- Feed generation with various note counts
- RFC-822 date formatting
- Note title extraction
- HTML cleaning for CDATA safety
- Feed structure validation
- Special characters and Unicode handling
test_routes_feed.py:
- Feed route accessibility and response
- Content-Type and cache headers
- ETag generation and validation
- Server-side caching behavior
- Published notes filtering
- Feed item limit configuration
- Configuration integration
All tests follow existing test patterns and use proper fixtures.