1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Fixed #35232 -- Cached model's Options.verbose_name_raw.

This commit is contained in:
Adam Johnson
2024-02-18 21:49:25 +00:00
committed by Mariusz Felisiak
parent 28a3fbe004
commit f25d84f61a
3 changed files with 18 additions and 1 deletions

View File

@@ -222,6 +222,17 @@ class GetFieldByNameTests(OptionsBaseTests):
opts.apps.models_ready = True
class VerboseNameRawTests(SimpleTestCase):
def test_string(self):
# Clear cached property.
Relation._meta.__dict__.pop("verbose_name_raw", None)
self.assertEqual(Relation._meta.verbose_name_raw, "relation")
def test_gettext(self):
Person._meta.__dict__.pop("verbose_name_raw", None)
self.assertEqual(Person._meta.verbose_name_raw, "Person")
class RelationTreeTests(SimpleTestCase):
all_models = (Relation, AbstractPerson, BasePerson, Person, ProxyPerson, Relating)