diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index dc9cfa836e..975653d410 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -2369,9 +2369,9 @@ class UUIDField(Field): description = 'Universally unique identifier' empty_strings_allowed = False - def __init__(self, **kwargs): + def __init__(self, verbose_name=None, **kwargs): kwargs['max_length'] = 32 - super(UUIDField, self).__init__(**kwargs) + super(UUIDField, self).__init__(verbose_name, **kwargs) def deconstruct(self): name, path, args, kwargs = super(UUIDField, self).deconstruct() diff --git a/tests/model_fields/models.py b/tests/model_fields/models.py index 3decc29aba..bc96bf3f9b 100644 --- a/tests/model_fields/models.py +++ b/tests/model_fields/models.py @@ -179,6 +179,8 @@ class VerboseNameField(models.Model): field19 = models.TextField("verbose field19") field20 = models.TimeField("verbose field20") field21 = models.URLField("verbose field21") + field22 = models.UUIDField("verbose field22") + field23 = models.DurationField("verbose field23") class GenericIPAddress(models.Model): diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py index 379d9e8b52..a8291b6e71 100644 --- a/tests/model_fields/tests.py +++ b/tests/model_fields/tests.py @@ -76,7 +76,7 @@ class BasicFieldTests(test.TestCase): def test_field_verbose_name(self): m = VerboseNameField - for i in range(1, 22): + for i in range(1, 24): self.assertEqual(m._meta.get_field('field%d' % i).verbose_name, 'verbose field%d' % i)