summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-03-04 12:21:33 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-03-04 12:25:17 +0100
commit6dea42febaae82084c2ca5fef25b9e535e6bd794 (patch)
tree0cde14b9cebc30d2a85fd4c70002b5232fef7fc0 /tests
parent1b3a900a6919f9ffcfe22fae738e49b71e798ee0 (diff)
Added tests for BaseDatabaseIntrospection's stub methods.
Diffstat (limited to 'tests')
-rw-r--r--tests/backends/base/test_introspection.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/backends/base/test_introspection.py b/tests/backends/base/test_introspection.py
new file mode 100644
index 0000000000..2b8fbedd8e
--- /dev/null
+++ b/tests/backends/base/test_introspection.py
@@ -0,0 +1,32 @@
+from django.db import connection
+from django.db.backends.base.introspection import BaseDatabaseIntrospection
+from django.test import SimpleTestCase
+
+
+class SimpleDatabaseIntrospectionTests(SimpleTestCase):
+ may_require_msg = (
+ 'subclasses of BaseDatabaseIntrospection may require a %s() method'
+ )
+
+ def setUp(self):
+ self.introspection = BaseDatabaseIntrospection(connection=connection)
+
+ def test_get_table_list(self):
+ msg = self.may_require_msg % 'get_table_list'
+ with self.assertRaisesMessage(NotImplementedError, msg):
+ self.introspection.get_table_list(None)
+
+ def test_get_sequences(self):
+ msg = self.may_require_msg % 'get_sequences'
+ with self.assertRaisesMessage(NotImplementedError, msg):
+ self.introspection.get_sequences(None, None)
+
+ def test_get_key_columns(self):
+ msg = self.may_require_msg % 'get_key_columns'
+ with self.assertRaisesMessage(NotImplementedError, msg):
+ self.introspection.get_key_columns(None, None)
+
+ def test_get_constraints(self):
+ msg = self.may_require_msg % 'get_constraints'
+ with self.assertRaisesMessage(NotImplementedError, msg):
+ self.introspection.get_constraints(None, None)