Skip to content

Commit 754818f

Browse files
jonfroehlichclaude
andcommitted
docs(contributing): make_* helpers now delegate to factory_boy factories (#1272)
The make_* helpers no longer wrap plain Model.objects.create() — this PR rewrote them as thin wrappers over website/tests/factories.py. Update the CONTRIBUTING note so it points contributors at the factories as the source of truth and to use them directly for entities the helpers don't cover. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 76c448e commit 754818f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ The suite has two complementary styles:
264264
| **Unit** | `SimpleTestCase` + `MagicMock` | Pure logic — formatters, BibTeX generation, single-method behavior. No DB; runs in milliseconds. |
265265
| **Integration** | `DatabaseTestCase` (subclass of Django's `TestCase`, in `website/tests/base.py`) | View, queryset, template, and URL-routing regressions. Each test runs inside a transaction that is rolled back, so tests stay isolated. |
266266
267-
The `DatabaseTestCase` base provides `make_person`, `make_publication`, `make_talk`, and `make_news_item` helpers built on plain `Model.objects.create()` — use those rather than hand-rolling fixtures.
267+
The `DatabaseTestCase` base provides `make_person`, `make_publication`, `make_talk`, and `make_news_item` helpers — use those rather than hand-rolling fixtures. They're thin wrappers over the `factory_boy` factories in `website/tests/factories.py`, which are the single source of truth for building model instances; reach for a factory directly when you need an entity the helpers don't cover or want to customize fields.
268268
269269
### When to add a test
270270

0 commit comments

Comments
 (0)