summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_util/tests.py
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2010-10-17 15:17:52 +0000
committerJannis Leidel <jannis@leidel.info>2010-10-17 15:17:52 +0000
commit214dc97bf39789294304013ebcd2a5f4b49547cf (patch)
treea12a15c645e5597aabcff0730eb5e7e0de6a3f00 /tests/regressiontests/admin_util/tests.py
parent400125d718c6a005d81c7ed051a15687394c2743 (diff)
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
Diffstat (limited to 'tests/regressiontests/admin_util/tests.py')
-rw-r--r--tests/regressiontests/admin_util/tests.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/regressiontests/admin_util/tests.py b/tests/regressiontests/admin_util/tests.py
index 6979a7a573..518a16d151 100644
--- a/tests/regressiontests/admin_util/tests.py
+++ b/tests/regressiontests/admin_util/tests.py
@@ -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),
+ )