summaryrefslogtreecommitdiff
path: root/tests/backends
diff options
context:
space:
mode:
Diffstat (limited to 'tests/backends')
-rw-r--r--tests/backends/tests.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/backends/tests.py b/tests/backends/tests.py
index 4851995149..106fd7f856 100644
--- a/tests/backends/tests.py
+++ b/tests/backends/tests.py
@@ -32,6 +32,31 @@ from django.utils.six.moves import range
from . import models
+class DatabaseWrapperTests(SimpleTestCase):
+
+ def test_initialization_class_attributes(self):
+ """
+ The "initialization" class attributes like client_class and
+ creation_class should be set on the class and reflected in the
+ corresponding instance attributes of the instantiated backend.
+ """
+ conn = connections[DEFAULT_DB_ALIAS]
+ conn_class = type(conn)
+ attr_names = [
+ ('client_class', 'client'),
+ ('creation_class', 'creation'),
+ ('features_class', 'features'),
+ ('introspection_class', 'introspection'),
+ ('ops_class', 'ops'),
+ ('validation_class', 'validation'),
+ ]
+ for class_attr_name, instance_attr_name in attr_names:
+ class_attr_value = getattr(conn_class, class_attr_name)
+ self.assertIsNotNone(class_attr_value)
+ instance_attr_value = getattr(conn, instance_attr_name)
+ self.assertIsInstance(instance_attr_value, class_attr_value)
+
+
class DummyBackendTest(SimpleTestCase):
def test_no_databases(self):