Skip to content

Conversation

@amureki
Copy link
Member

@amureki amureki commented Jan 23, 2026

Describe the change
I guess, I accidentally fixed this long ago, just never added a regression test, shame on me.

PR Checklist

  • Change is covered with tests
  • CHANGELOG.md is updated if needed

Summary by CodeRabbit

  • Tests
    • Added regression test coverage to ensure that setting foreign key relationships to None does not inadvertently create phantom related objects in the system.

✏️ Tip: You can customize this high-level summary in your review settings.

@amureki amureki self-assigned this Jan 23, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

A regression test is added to verify that explicitly setting a foreign key field to None during recipe instance creation does not create phantom related model objects.

Changes

Cohort / File(s) Summary
Test Regression
tests/test_recipes.py
Added DummyNullFieldsModel to imports and introduced test_do_not_create_related_model_when_set_to_none regression test to verify that null-assigned foreign keys do not instantiate phantom related objects

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰✨ When None is set, no phantom appears,
Our test chases away phantom fears,
A foreign key tamed with care,
Proves related models won't snare—
Recipe magic, crystal and clear! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and specifically describes the main change: adding a regression test for overriding foreign keys, with a reference to the related issue.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

@amureki amureki merged commit 18a8cad into main Jan 23, 2026
45 checks passed
@amureki amureki deleted the 26/regression-test branch January 23, 2026 15:45
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