Ticket #19226: ticket_19226.2.diff

File ticket_19226.2.diff, 1.8 KB (added by Lebedev Ilya, 12 years ago)
  • django/contrib/admin/templates/admin/includes/fieldset.html

    diff --git a/django/contrib/admin/templates/admin/includes/fieldset.html b/django/contrib/admin/templates/admin/includes/fieldset.html
    index c8d08c8..09bc971 100644
    a b  
    1414                    {% else %}
    1515                        {{ field.label_tag }}
    1616                        {% if field.is_readonly %}
    17                             <p>{{ field.contents }}</p>
     17                            <p>{{ field.contents|linebreaksbr }}</p>
    1818                        {% else %}
    1919                            {{ field.field }}
    2020                        {% endif %}
  • tests/regressiontests/admin_views/tests.py

    diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
    index 72dc6a3..1bbf60f 100644
    a b class ReadonlyTest(TestCase):  
    31633163        self.assertContains(response, '<p class="help">Some help text for the content (with unicode ŠĐĆŽćžšđ)</p>', html=True)
    31643164        self.assertContains(response, '<p class="help">Some help text for the date (with unicode ŠĐĆŽćžšđ)</p>', html=True)
    31653165
    3166         p = Post.objects.create(title="I worked on readonly_fields", content="Its good stuff")
     3166        new_post_title = "I worked on\n multiline\n readonly_fields"
     3167        p = Post.objects.create(title=new_post_title, content="Its good stuff")
    31673168        response = self.client.get('/test_admin/admin/admin_views/post/%d/' % p.pk)
    31683169        self.assertContains(response, "%d amount of cool" % p.pk)
    3169 
     3170        self.assertContains(response, new_post_title)
     3171       
    31703172    def test_readonly_post(self):
    31713173        data = {
    31723174            "title": "Django Got Readonly Fields",
Back to Top