diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2013-03-03 14:30:36 -0800 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2013-03-03 14:30:36 -0800 |
| commit | 03e40140ff3d9506aed1d69cd0e7f764e1c8bce9 (patch) | |
| tree | 58d7c445e7276125059547cba772eb29bf0088c7 | |
| parent | 60dd4eabe772a773f74493e05162af6b9eb86249 (diff) | |
| parent | f39fead1c37f1b6ed8772e252f96adee44447a3d (diff) | |
Merge pull request #871 from matiasb/ticket_19945
Fixed #19945 -- Fixed default User model Meta inheritance.
| -rw-r--r-- | django/contrib/auth/models.py | 2 | ||||
| -rw-r--r-- | django/contrib/auth/tests/basic.py | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index 1b63833688..df3851d353 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -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' diff --git a/django/contrib/auth/tests/basic.py b/django/contrib/auth/tests/basic.py index 097bc90451..ec94fe5b46 100644 --- a/django/contrib/auth/tests/basic.py +++ b/django/contrib/auth/tests/basic.py @@ -12,6 +12,7 @@ from django.core.exceptions import ImproperlyConfigured from django.core.management 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 @@ class BasicTestCase(TestCase): "The current user model must point to an installed model" with self.assertRaises(ImproperlyConfigured): get_user_model() + + @skipIfCustomUser + 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') |
