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