mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #17760 -- Implemented callable database features as cached properties
This does remove the requirement to call features.confirm() method before checking the properties. Thanks cdestiger and Ramiro Morales for their work on the patch.
This commit is contained in:
parent
484fcd34a4
commit
aa423575e7
7 changed files with 29 additions and 47 deletions
|
@ -403,8 +403,7 @@ class BackendTestCase(TestCase):
|
|||
self.assertTrue(hasattr(connection.ops, 'connection'))
|
||||
self.assertEqual(connection, connection.ops.connection)
|
||||
|
||||
def test_supports_needed_confirm(self):
|
||||
connection.features.confirm()
|
||||
def test_cached_db_features(self):
|
||||
self.assertIn(connection.features.supports_transactions, (True, False))
|
||||
self.assertIn(connection.features.supports_stddev, (True, False))
|
||||
self.assertIn(connection.features.can_introspect_foreign_keys, (True, False))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue