Fix warnings about duplicate model registrations in tests.

Review Request #14535 — Created July 30, 2025 and submitted — Latest diff uploaded

Information

Djblets
release-6.x

Reviewers

Our TestModelsLoaderMixin was never 100% updated when Django added
AppConfig, and this meant that the tear-down for test cases that define
a tests_app wasn't quite correct. The app got properly removed from
INSTALLED_APPS, but we were no longer removing models correctly.
This manifested in test cases that use the djblets.integrations.tests
app.

The fix here involves a couple parts: the mixin has been updated to
properly look up the app config and use its label, and a new AppConfig
has been added for djblets.integrations.tests that defines a label so
it doesn't just get turned into "tests".

Ran unit tests and no longer saw ugly warnings about models already
being registered.

Commits

Files