  from functools import wraps
  
  from django.db import IntegrityError, connections, transaction
  from django.test import TestCase, skipUnlessDBFeature
  from django.test.testcases import TestData
  
  from .models import Car, Person, PossessedCar
  
  
  class TestTestCase(TestCase):
 
</s> remove         raise AssertionError(self.message)
 </s> add         raise DatabaseOperationForbidden(self.message) </s> remove         with self.assertRaisesMessage(AssertionError, expected_message):
 </s> add         with self.assertRaisesMessage(DatabaseOperationForbidden, expected_message):
from django.test.testcases import DatabaseOperationForbidden, TestData
  from functools import wraps
  
  from django.db import IntegrityError, connections, transaction
  from django.test import TestCase, skipUnlessDBFeature
from django.test.testcases import DatabaseOperationForbidden, TestData
  
  from .models import Car, Person, PossessedCar
  
  
  class TestTestCase(TestCase):
keep keep keep keep replace keep keep keep keep keep
 Fixed #33278 -- Improved error for connection/query attempts against disallowed databases in tests. 
tests/test_utils/test_testcase.py