summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoravas9366 <avassallo06@gmail.com>2019-03-05 11:25:27 +1100
committerTim Graham <timograham@gmail.com>2019-03-04 19:25:27 -0500
commit9681e968ebdcd58cac99c1e60f0a6932abd4e5c9 (patch)
tree946f6a9f1b9501fa64ad9aeb98c2c40134ae3443
parent17455e924e243e7a55e8a38f45966d8cbb27c273 (diff)
Fixed #30232 -- Corrected expected format in invalid DurationField error message.
-rw-r--r--django/db/models/fields/__init__.py2
-rw-r--r--tests/model_fields/test_durationfield.py2
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."
)