Skip to content

test: add Mezzanine golden fixture#17

Merged
FROWNINGdev merged 1 commit into
FROWNINGdev:mainfrom
Nitjsefnie:test/13-mezzanine-golden-fixture
Jul 18, 2026
Merged

test: add Mezzanine golden fixture#17
FROWNINGdev merged 1 commit into
FROWNINGdev:mainfrom
Nitjsefnie:test/13-mezzanine-golden-fixture

Conversation

@Nitjsefnie

Copy link
Copy Markdown
Contributor

Adds a Mezzanine golden fixture under cli/tests/fixtures/golden/mezzanine/.

Vendored upstream file

The file is preserved verbatim (mirrors the upstream path) and is attributed in cli/tests/fixtures/golden/mezzanine/README.md under the BSD-2-Clause licence.

What this coverage exercises

  • Abstract/multi-base inheritance: BlogPost inherits from Displayable, Ownable, RichText, and AdminThumbMixin.
  • Real-world custom field types and settings references (e.g. FileField, CommentsField, RatingField, mezzanine.conf.settings).
  • Verifies the parser still finds ≥1 model and does not raise.

Golden output generation
The existing cli/tests/test_golden_fixtures.py parametrizes over fixture directories and runs scan_workspace; the new fixture is picked up automatically by directory discovery. pytest was run from cli/.

Gates

  • pytest -q (from cli/): 45 passed.
  • ruff check ../scripts/fetch_golden_fixtures.py tests/test_golden_fixtures.py: clean.
  • Pre-existing ruff lints in parser/CLI source were left untouched (out of scope).

Closes #13

Prepared with AI assistance (Kimi K2.7 Code), human-reviewed before submission.

Vendored from stephenmcd/mezzanine@master mezzanine/blog/models.py.

Adds BSD-2 attribution and extends the golden fixture fetch script.

Co-Authored-By: Kimi K2.7 Code <noreply@kimi.com>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Nitjsefnie, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7709907a-cba3-4e03-a07e-9b093441d0b1

📥 Commits

Reviewing files that changed from the base of the PR and between a92d5b1 and bb817c7.

📒 Files selected for processing (5)
  • cli/tests/fixtures/golden/README.md
  • cli/tests/fixtures/golden/mezzanine/README.md
  • cli/tests/fixtures/golden/mezzanine/mezzanine/blog/models.py
  • cli/tests/test_golden_fixtures.py
  • scripts/fetch_golden_fixtures.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Nitjsefnie

Copy link
Copy Markdown
Contributor Author

One thing worth flagging that this fixture surfaced, since it's baked into the golden output rather than being a bug in this PR.

mezzanine/blog/models.py defines two model classes, but only BlogPost is detected. BlogCategory inherits from Slugged, which lives in mezzanine.core.models — outside the vendored file. The transitive resolution in parser.py:331-343 seeds is_model_name only from classes defined in the parsed file(s) (all_defs), and _looks_like_model (parser.py:203) matches on the base-class name, so a base imported from another module is never recognised as a model. BlogCategory therefore drops out.

That pattern — concrete models inheriting from an abstract base in a different app/module — is extremely common in real Django projects, so the gap probably costs real coverage beyond this fixture. I've deliberately left the parser alone and recorded the golden output as-is, per the "fixture only, no parser changes" scope: the committed golden file documents current behaviour, and the test asserts ≥1 model, which passes.

Happy to open a separate issue for the cross-module base resolution if that's useful — or if you'd rather the fixture wait until that's fixed, say the word and I'll hold it.

@FROWNINGdev
FROWNINGdev merged commit f079710 into FROWNINGdev:main Jul 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fixture: add golden test for Mezzanine models

2 participants