Context
The golden-fixture suite vendors real models.py files from five established Django projects — Zulip, Saleor, Wagtail, django-CMS and Mezzanine — and asserts the parser both survives them (cli/tests/test_golden_fixtures.py) and produces byte-stable output (cli/tests/test_golden_snapshots.py). This is how parser regressions get caught against code nobody on this project wrote.
Five projects is a decent spread, but it skews toward CMS-shaped schemas. Adding a project from a different domain — e-commerce with heavy Decimal/inventory modelling, or a docs platform, or anything leaning on abstract base classes and multi-table inheritance — buys real coverage.
What to change
scripts/fetch_golden_fixtures.py reproduces the vendored tree from GitHub via gh api, so this is mostly mechanical:
- Pick a project and verify its licence permits verbatim redistribution — Apache-2.0, BSD-2-Clause, BSD-3-Clause and MIT are all fine. Copyleft licences such as GPL/AGPL are not, so Weblate, Misago and Taiga are out.
django-oscar (BSD-3-Clause) and readthedocs.org (MIT) are both reasonable candidates if you want one picked for you.
- Add it to the fetch script and run it. Vendor only
models.py files, each at its original relative path — scan_workspace relies on those paths to infer app-directory boundaries.
- Preserve every top-of-file copyright and licence header unchanged.
- Add the project to the attribution table in
cli/tests/fixtures/golden/README.md and update the Fetch date line.
- Generate the snapshot:
cd cli && UPDATE_GOLDEN_SNAPSHOTS=1 python -m pytest tests/test_golden_snapshots.py
The snapshot must land at fixtures/golden/<project>.snapshot.json — a plain file beside the project directory, never inside it. test_golden_fixtures.py treats every subdirectory of golden/ as a vendored project via iterdir, so a nested snapshot folder breaks its parametrization.
Watch out for
There is a hard performance gate: all golden fixtures combined must scan in under 2 seconds (test_golden_fixtures.py:35). If the project you pick is enormous, vendor a representative subset of apps rather than everything.
Acceptance criteria
pytest cli/tests -v green, including the 2-second budget.
- Snapshot committed; attribution table and fetch date updated.
- The PR states the project's licence and links its
LICENSE file.
Getting started
pip install -e "cli[dev]"
pytest cli/tests/test_golden_fixtures.py cli/tests/test_golden_snapshots.py -v
Context
The golden-fixture suite vendors real
models.pyfiles from five established Django projects — Zulip, Saleor, Wagtail, django-CMS and Mezzanine — and asserts the parser both survives them (cli/tests/test_golden_fixtures.py) and produces byte-stable output (cli/tests/test_golden_snapshots.py). This is how parser regressions get caught against code nobody on this project wrote.Five projects is a decent spread, but it skews toward CMS-shaped schemas. Adding a project from a different domain — e-commerce with heavy
Decimal/inventory modelling, or a docs platform, or anything leaning on abstract base classes and multi-table inheritance — buys real coverage.What to change
scripts/fetch_golden_fixtures.pyreproduces the vendored tree from GitHub viagh api, so this is mostly mechanical:django-oscar(BSD-3-Clause) andreadthedocs.org(MIT) are both reasonable candidates if you want one picked for you.models.pyfiles, each at its original relative path —scan_workspacerelies on those paths to infer app-directory boundaries.cli/tests/fixtures/golden/README.mdand update the Fetch date line.fixtures/golden/<project>.snapshot.json— a plain file beside the project directory, never inside it.test_golden_fixtures.pytreats every subdirectory ofgolden/as a vendored project viaiterdir, so a nested snapshot folder breaks its parametrization.Watch out for
There is a hard performance gate: all golden fixtures combined must scan in under 2 seconds (
test_golden_fixtures.py:35). If the project you pick is enormous, vendor a representative subset of apps rather than everything.Acceptance criteria
pytest cli/tests -vgreen, including the 2-second budget.LICENSEfile.Getting started
pip install -e "cli[dev]" pytest cli/tests/test_golden_fixtures.py cli/tests/test_golden_snapshots.py -v