From 9681e968ebdcd58cac99c1e60f0a6932abd4e5c9 Mon Sep 17 00:00:00 2001 From: avas9366 Date: Tue, 5 Mar 2019 11:25:27 +1100 Subject: [PATCH] Fixed #30232 -- Corrected expected format in invalid DurationField error message. --- django/db/models/fields/__init__.py | 2 +- tests/model_fields/test_durationfield.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index f32ce64629..71005490f3 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -1587,7 +1587,7 @@ class DurationField(Field): empty_strings_allowed = False default_error_messages = { 'invalid': _("'%(value)s' value has an invalid format. It must be in " - "[DD] [HH:[MM:]]ss[.uuuuuu] format.") + "[DD] [[HH:]MM:]ss[.uuuuuu] format.") } description = _("Duration") diff --git a/tests/model_fields/test_durationfield.py b/tests/model_fields/test_durationfield.py index b73994f86a..f1c82ab8bd 100644 --- a/tests/model_fields/test_durationfield.py +++ b/tests/model_fields/test_durationfield.py @@ -75,7 +75,7 @@ class TestValidation(SimpleTestCase): self.assertEqual( cm.exception.message % cm.exception.params, "'not a datetime' value has an invalid format. " - "It must be in [DD] [HH:[MM:]]ss[.uuuuuu] format." + "It must be in [DD] [[HH:]MM:]ss[.uuuuuu] format." )