1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #28926 -- Fixed loss of precision of big DurationField values on SQLite and MySQL.

This commit is contained in:
Sergey Fedoseev
2017-12-29 03:35:41 +05:00
committed by Tim Graham
parent 46d1af2e82
commit ae6fa914aa
7 changed files with 47 additions and 7 deletions

View File

@@ -12,7 +12,7 @@ from .models import DurationModel, NullDurationModel
class TestSaveLoad(TestCase):
def test_simple_roundtrip(self):
duration = datetime.timedelta(days=123, seconds=123, microseconds=123)
duration = datetime.timedelta(microseconds=8999999999999999)
DurationModel.objects.create(field=duration)
loaded = DurationModel.objects.get()
self.assertEqual(loaded.field, duration)