Fix warnings about duplicate model registrations in tests.
Review Request #14535 — Created July 30, 2025 and submitted — Latest diff uploaded
Our TestModelsLoaderMixin was never 100% updated when Django added
AppConfig, and this meant that the tear-down for test cases that define
atests_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 thedjblets.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 newAppConfig
has been added fordjblets.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.