From fe3c9ad55103f8fe473bdcf77d06cb958cbaf217 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 19 Feb 2011 12:55:09 +0000 Subject: Fixed #14355 -- Ensure that help_text is displayed for readonly fields in the admin. Thanks to jester for the report, and to alexbmeng, subsume, wamberg and Julien Phalip for ther work on the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15582 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/admin_views/models.py | 9 ++++++--- tests/regressiontests/admin_views/tests.py | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'tests/regressiontests') diff --git a/tests/regressiontests/admin_views/models.py b/tests/regressiontests/admin_views/models.py index b601267e57..58a545a64a 100644 --- a/tests/regressiontests/admin_views/models.py +++ b/tests/regressiontests/admin_views/models.py @@ -523,9 +523,12 @@ class LinkInline(admin.TabularInline): class Post(models.Model): - title = models.CharField(max_length=100) - content = models.TextField() - posted = models.DateField(default=datetime.date.today) + title = models.CharField(max_length=100, help_text="Some help text for the title (with unicode ŠĐĆŽćžšđ)") + content = models.TextField(help_text="Some help text for the content (with unicode ŠĐĆŽćžšđ)") + posted = models.DateField( + default=datetime.date.today, + help_text="Some help text for the date (with unicode ŠĐĆŽćžšđ)" + ) public = models.NullBooleanField() def awesomeness_level(self): diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index 2685a05caa..f77c64bd21 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -2453,6 +2453,10 @@ class ReadonlyTest(TestCase): self.assertContains(response, '
') self.assertContains(response, '
') self.assertContains(response, '
') + self.assertContains(response, '

', 3) + self.assertContains(response, '

Some help text for the title (with unicode ŠĐĆŽćžšđ)

') + self.assertContains(response, '

Some help text for the content (with unicode ŠĐĆŽćžšđ)

') + self.assertContains(response, '

Some help text for the date (with unicode ŠĐĆŽćžšđ)

') p = Post.objects.create(title="I worked on readonly_fields", content="Its good stuff") response = self.client.get('/test_admin/admin/admin_views/post/%d/' % p.pk) -- cgit v1.3