1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #13963 -- Use the correct verbose name of a reverse relation field in the admin. Thanks, sfllaw and d0ugal.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14244 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2010-10-17 15:17:52 +00:00
parent 400125d718
commit 214dc97bf3
3 changed files with 37 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ from django.test import TestCase
from django.utils import unittest
from django.utils.formats import localize
from models import Article, Count
from models import Article, Count, Event, Location
class NestedObjectsTests(TestCase):
@@ -219,3 +219,20 @@ class UtilTests(unittest.TestCase):
),
("not Really the Model", MockModelAdmin.test_from_model)
)
def test_related_name(self):
"""
Regression test for #13963
"""
self.assertEquals(
label_for_field('location', Event, return_attr=True),
('location', None),
)
self.assertEquals(
label_for_field('event', Location, return_attr=True),
('awesome event', None),
)
self.assertEquals(
label_for_field('guest', Event, return_attr=True),
('awesome guest', None),
)