mirror of https://github.com/django/django.git
Fixed #33214 -- Added BaseDatabaseOperations.format_for_duration_arithmetic() stub method.
This commit is contained in:
parent
9231526af4
commit
551c997fea
|
@ -74,6 +74,12 @@ class BaseDatabaseOperations:
|
|||
"""
|
||||
return len(objs)
|
||||
|
||||
def format_for_duration_arithmetic(self, sql):
|
||||
raise NotImplementedError(
|
||||
'subclasses of BaseDatabaseOperations may require a '
|
||||
'format_for_duration_arithmetic() method.'
|
||||
)
|
||||
|
||||
def cache_key_culling_sql(self):
|
||||
"""
|
||||
Return an SQL query that retrieves the first cache key greater than the
|
||||
|
|
|
@ -85,6 +85,11 @@ class SimpleDatabaseOperationTests(SimpleTestCase):
|
|||
now = timezone.now()
|
||||
self.assertEqual(self.ops.adapt_timefield_value(now), str(now))
|
||||
|
||||
def test_format_for_duration_arithmetic(self):
|
||||
msg = self.may_require_msg % 'format_for_duration_arithmetic'
|
||||
with self.assertRaisesMessage(NotImplementedError, msg):
|
||||
self.ops.format_for_duration_arithmetic(None)
|
||||
|
||||
def test_date_extract_sql(self):
|
||||
with self.assertRaisesMessage(NotImplementedError, self.may_require_msg % 'date_extract_sql'):
|
||||
self.ops.date_extract_sql(None, None)
|
||||
|
|
Loading…
Reference in New Issue