Take a look at this section:
https://docs.djangoproject.com/en/5.2/topics/testing/tools/#django.test.SimpleTestCase.databases
There is a comment in there about overriding settings...
SimpleTestCaseand its subclasses (e.g.TestCase, …) rely onsetUpClass()andtearDownClass()to perform some class-wide initialization (e.g. overriding settings).