Update for changes in fixture loading.

Review Request #14783 — Created Jan. 15, 2026 and updated

Information

Djblets
release-6.x

Reviewers

Django 5.2 made an un-announced change that moved fixture loading to
happen at class init time rather than per-test-method. As part of this,
the _load_fixtures method has been made a @classmethod. This is a
fundamentally better approach, but causes numerous problems with our own
fixture code.

This change updates our FixturesCompilerMixin to operate at class-time
rather than at test function time. This requires changing the way we
hide the fixtures classvar from the parent class, since
__getattribute__ can't work.

The @add_fixtures decorator is now a performance hit rather than a
performance benefit. In addition, the replace argument is no longer
possible (but luckily, nothing actually used that). I've added a warning
about the performance implications, but for now it's hidden behind an
environment variable because we use this decorator a lot.

Ran unit tests and verified that fixtures worked appropriately.

Summary ID
Update for changes in fixture loading.
Django 5.2 made an un-announced change that moved fixture loading to happen at class init time rather than per-test-method. As part of this, the `_load_fixtures` method has been made a `@classmethod`. This is a fundamentally better approach, but causes numerous problems with our own fixture code. This change updates our `FixturesCompilerMixin` to operate at class-time rather than at test function time. This requires changing the way we hide the `fixtures` classvar from the parent class, since `__getattribute__` can't work. The `@add_fixtures` decorator is now a performance hit rather than a performance benefit. In addition, the `replace` argument is no longer possible (but luckily, nothing actually used that). I've added a warning about the performance implications, but for now it's hidden behind an environment variable because we use this decorator a lot. Testing Done: Ran unit tests and verified that fixtures worked appropriately.
vozroonuuumnwwkwllsykxxkovwrwzsr
Description From Last Updated

redefinition of unused 'Sequence' from line 18 Column: 5 Error code: F811

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
Review request changed
Commits:
Summary ID
Update for changes in fixture loading.
Django 5.2 made an un-announced change that moved fixture loading to happen at class init time rather than per-test-method. As part of this, the `_load_fixtures` method has been made a `@classmethod`. This is a fundamentally better approach, but causes numerous problems with our own fixture code. This change updates our `FixturesCompilerMixin` to operate at class-time rather than at test function time. This requires changing the way we hide the `fixtures` classvar from the parent class, since `__getattribute__` can't work. The `@add_fixtures` decorator is now a performance hit rather than a performance benefit. In addition, the `replace` argument is no longer possible (but luckily, nothing actually used that). I've added a warning about the performance implications, but for now it's hidden behind an environment variable because we use this decorator a lot. Testing Done: Ran unit tests and verified that fixtures worked appropriately.
vozroonuuumnwwkwllsykxxkovwrwzsr
Update for changes in fixture loading.
Django 5.2 made an un-announced change that moved fixture loading to happen at class init time rather than per-test-method. As part of this, the `_load_fixtures` method has been made a `@classmethod`. This is a fundamentally better approach, but causes numerous problems with our own fixture code. This change updates our `FixturesCompilerMixin` to operate at class-time rather than at test function time. This requires changing the way we hide the `fixtures` classvar from the parent class, since `__getattribute__` can't work. The `@add_fixtures` decorator is now a performance hit rather than a performance benefit. In addition, the `replace` argument is no longer possible (but luckily, nothing actually used that). I've added a warning about the performance implications, but for now it's hidden behind an environment variable because we use this decorator a lot. Testing Done: Ran unit tests and verified that fixtures worked appropriately.
vozroonuuumnwwkwllsykxxkovwrwzsr

Checks run (2 succeeded)

flake8 passed.
JSHint passed.