mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #28925 -- Fixed durations-only expressions crash on SQLite and MySQL.
This removes also unused DatabaseOperations.date_interval_sql().
This commit is contained in:
parent
9d752dabe3
commit
dd5aa8cb5f
6 changed files with 22 additions and 40 deletions
|
@ -1468,6 +1468,12 @@ class FTimeDeltaTests(TestCase):
|
|||
))
|
||||
self.assertIsNone(queryset.first().shifted)
|
||||
|
||||
def test_duration_expressions(self):
|
||||
for delta in self.deltas:
|
||||
qs = Experiment.objects.annotate(duration=F('estimated_time') + delta)
|
||||
for obj in qs:
|
||||
self.assertEqual(obj.duration, obj.estimated_time + delta)
|
||||
|
||||
@skipUnlessDBFeature('supports_temporal_subtraction')
|
||||
def test_date_subtraction(self):
|
||||
queryset = Experiment.objects.annotate(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue