Browse files

Fixed #19945 -- Fixed default User model Meta inheritance.

Updated default User model Meta class to extend AbstractUser Meta
where translated verbose_name and verbose_name_plural are
  • Loading branch information...
matiasb committed Mar 1, 2013
1 parent 0c82b1d commit f39fead1c37f1b6ed8772e252f96adee44447a3d
Showing with 12 additions and 1 deletion.
  1. +1 −1 django/contrib/auth/
  2. +11 −0 django/contrib/auth/tests/
@@ -461,7 +461,7 @@ class User(AbstractUser):
Username, password and email are required. Other fields are optional.
class Meta:
class Meta(AbstractUser.Meta):
swappable = 'AUTH_USER_MODEL'
@@ -12,6 +12,7 @@
from import call_command
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import translation
from django.utils.encoding import force_str
from django.utils.six import binary_type, PY3, StringIO
@@ -232,3 +233,13 @@ def test_swappable_user_nonexistent_model(self):
"The current user model must point to an installed model"
with self.assertRaises(ImproperlyConfigured):
def test_user_verbose_names_translatable(self):
"Default User model verbose names are translatable (#19945)"
with translation.override('en'):
self.assertEqual(User._meta.verbose_name, 'user')
self.assertEqual(User._meta.verbose_name_plural, 'users')
with translation.override('es'):
self.assertEqual(User._meta.verbose_name, 'usuario')
self.assertEqual(User._meta.verbose_name_plural, 'usuarios')

0 comments on commit f39fead

Please sign in to comment.