diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2011-02-19 12:56:25 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2011-02-19 12:56:25 +0000 |
| commit | 909ee62563f5c9ff7f507028f19ee291a134ea30 (patch) | |
| tree | 205e50b81488dba4ef8f69e011cde2ee8e3b2eab /tests | |
| parent | da4dea5834682e16e446f2a1c671c1989fb42404 (diff) | |
[1.2.X] 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.
Backport of r15582 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15583 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/admin_views/models.py | 9 | ||||
| -rw-r--r-- | tests/regressiontests/admin_views/tests.py | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/tests/regressiontests/admin_views/models.py b/tests/regressiontests/admin_views/models.py index 0c3f70102d..6e0f9997fb 100644 --- a/tests/regressiontests/admin_views/models.py +++ b/tests/regressiontests/admin_views/models.py @@ -496,9 +496,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 7d3cc33438..e93ec66e4d 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -2263,6 +2263,10 @@ class ReadonlyTest(TestCase): self.assertContains(response, '<div class="form-row posted">') self.assertContains(response, '<div class="form-row value">') self.assertContains(response, '<div class="form-row ">') + self.assertContains(response, '<p class="help">', 3) + self.assertContains(response, '<p class="help">Some help text for the title (with unicode ŠĐĆŽćžšđ)</p>') + self.assertContains(response, '<p class="help">Some help text for the content (with unicode ŠĐĆŽćžšđ)</p>') + self.assertContains(response, '<p class="help">Some help text for the date (with unicode ŠĐĆŽćžšđ)</p>') 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) |
