1. from django.db import connection
    
  2. from django.db.backends.base.introspection import BaseDatabaseIntrospection
    
  3. from django.test import SimpleTestCase
    
  4. 
    
  5. 
    
  6. class SimpleDatabaseIntrospectionTests(SimpleTestCase):
    
  7.     may_require_msg = (
    
  8.         "subclasses of BaseDatabaseIntrospection may require a %s() method"
    
  9.     )
    
  10. 
    
  11.     def setUp(self):
    
  12.         self.introspection = BaseDatabaseIntrospection(connection=connection)
    
  13. 
    
  14.     def test_get_table_list(self):
    
  15.         msg = self.may_require_msg % "get_table_list"
    
  16.         with self.assertRaisesMessage(NotImplementedError, msg):
    
  17.             self.introspection.get_table_list(None)
    
  18. 
    
  19.     def test_get_table_description(self):
    
  20.         msg = self.may_require_msg % "get_table_description"
    
  21.         with self.assertRaisesMessage(NotImplementedError, msg):
    
  22.             self.introspection.get_table_description(None, None)
    
  23. 
    
  24.     def test_get_sequences(self):
    
  25.         msg = self.may_require_msg % "get_sequences"
    
  26.         with self.assertRaisesMessage(NotImplementedError, msg):
    
  27.             self.introspection.get_sequences(None, None)
    
  28. 
    
  29.     def test_get_relations(self):
    
  30.         msg = self.may_require_msg % "get_relations"
    
  31.         with self.assertRaisesMessage(NotImplementedError, msg):
    
  32.             self.introspection.get_relations(None, None)
    
  33. 
    
  34.     def test_get_constraints(self):
    
  35.         msg = self.may_require_msg % "get_constraints"
    
  36.         with self.assertRaisesMessage(NotImplementedError, msg):
    
  37.             self.introspection.get_constraints(None, None)