Skip to content

Fix missing models import in test fixtures - #64

Merged
FROWNINGdev merged 1 commit into
FROWNINGdev:mainfrom
RinZ27:fix/missing-models-import
Aug 1, 2026
Merged

Fix missing models import in test fixtures#64
FROWNINGdev merged 1 commit into
FROWNINGdev:mainfrom
RinZ27:fix/missing-models-import

Conversation

@RinZ27

@RinZ27 RinZ27 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Found a minor issue where the models module wasn't explicitly imported in the parity_input.py test fixture. This caused undefined name errors during linting. Added the missing from django.db import models import to resolve it and keep the test suite completely green.

Type of change

  • Bug fix (non-breaking, restores expected behaviour)
  • Feature (non-breaking, adds a capability)
  • Breaking change (existing users have to update config or code)
  • Docs / README / comments only (no runtime effect)
  • Internal refactor (no behaviour change, no public API change)
  • Dependency bump
  • CI / build / tooling

Test plan

ruff check test/fixtures/parity_input.py

Verified the linting passes without the F821 undefined name error.

Checklist

  • I ran the full test suite locally (cd cli && pytest -q for Python, npm test for TypeScript) and it is green
  • I added or updated tests that cover the change (bugfixes should get a regression test)
  • If the change is user-facing I updated the CHANGELOG under ## [Unreleased]
  • If the change touches the MCP tool contract (new tool, new arg, new error code) I updated the tool description in mcp_server.py and the relevant tests in test_mcp_server.py
  • If this is a breaking change I called it out under ## Summary above and suggested a migration path

Related issues / discussions

Resolves an undefined name models error in the parity_input.py fixture by explicitly importing django.db.models.
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The parity fixture now imports django.db.models. No model declarations or behavior changed.

Changes

Parity fixture update

Layer / File(s) Summary
Django models import
test/fixtures/parity_input.py
The fixture adds the django.db.models import. Model declarations remain unchanged.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the missing Django models import added to the test fixture.
✨ 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.

@FROWNINGdev
FROWNINGdev merged commit 49058a3 into FROWNINGdev:main Aug 1, 2026
18 checks passed
@FROWNINGdev

Copy link
Copy Markdown
Owner

Merged — thanks.

One correction to the description, so the repo history doesn't carry a claim that isn't true: this wasn't fixing a lint failure. CI runs ruff check django_orm_lens tests from cli/, so the repo-root test/fixtures/ is never linted, and cli/pyproject.toml excludes tests/fixtures on top of that. main was green before this PR and would have stayed green without it.

The change is still worth taking, just for a different reason: the fixture is meant to look like a real models.py, and a real one has that import. If the directory is ever brought into the lint scope, it starts out clean instead of with 17 F821s.

I checked it can't affect the parity test before merging — test/parity.test.js asserts model shape only (names, field counts, types, relationKind, onDelete, related_name, Meta), never line numbers, so shifting the file by two lines is inert.

FROWNINGdev added a commit that referenced this pull request Aug 1, 2026
Both contributions from 2026-08-01, recorded in the changelog and the README
roadmap rather than only in the reply threads.

@Justine0211 found the USE_TZ error in DOL021 while translating the page into
Simplified Chinese — by declining to translate a claim they could not verify
against the Django release notes. @RinZ27 supplied the models import for the
parity fixture in #64.
@RinZ27
RinZ27 deleted the fix/missing-models-import branch August 1, 2026 13:26
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.

2 participants