diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 19f090863b..e0534b823b 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -2377,9 +2377,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 3d25c89607..c988fce246 100644 --- a/tests/model_fields/models.py +++ b/tests/model_fields/models.py @@ -180,6 +180,8 @@ class VerboseNameField(models.Model): field20 = models.TextField("verbose field20") field21 = models.TimeField("verbose field21") field22 = models.URLField("verbose field22") + field23 = models.UUIDField("verbose field23") + field24 = models.DurationField("verbose field24") class GenericIPAddress(models.Model): diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py index 080808520f..81f62b6e3d 100644 --- a/tests/model_fields/tests.py +++ b/tests/model_fields/tests.py @@ -75,7 +75,7 @@ class BasicFieldTests(test.TestCase): def test_field_verbose_name(self): m = VerboseNameField - for i in range(1, 23): + for i in range(1, 25): self.assertEqual(m._meta.get_field('field%d' % i).verbose_name, 'verbose field%d' % i)