  
  from django.db import connections
  from django.test import TestCase, TransactionTestCase, override_settings
  
  from .models import Car
  
  
  class TestSerializedRollbackInhibitsPostMigrate(TransactionTestCase):
 
</s> remove from django.test.testcases import TestData
 </s> add from django.test.testcases import DatabaseOperationForbidden, TestData </s> remove         with self.assertRaisesMessage(AssertionError, message):
 </s> add         with self.assertRaisesMessage(DatabaseOperationForbidden, message): </s> remove         raise AssertionError(self.message)
 </s> add         raise DatabaseOperationForbidden(self.message)
from django.test.testcases import DatabaseOperationForbidden
  
  from django.db import connections
  from django.test import TestCase, TransactionTestCase, override_settings
from django.test.testcases import DatabaseOperationForbidden
  
  from .models import Car
  
  
  class TestSerializedRollbackInhibitsPostMigrate(TransactionTestCase):
keep keep add keep keep keep keep keep
 Fixed #33278 -- Improved error for connection/query attempts against disallowed databases in tests. 
tests/test_utils/test_transactiontestcase.py