diff options
| author | Alexander Gaevsky <sasha@sasha0.ru> | 2015-12-24 23:32:53 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-12-29 19:37:29 -0500 |
| commit | 312e488a218a0c115cd23243b328dee5aee45965 (patch) | |
| tree | 6af816d996f2d5cace588babe17eb92041b47db3 /tests/admin_views/tests.py | |
| parent | 5f3c5e40b25f2b7ab1f42bfa0169fe40c35e97bb (diff) | |
[1.9.x] Fixed #25465 -- Restored line breaks conversion in admin readonly fields.
Backport of 69208a5a1c55d42ca0eaffa900be643d9f801089 from master
Diffstat (limited to 'tests/admin_views/tests.py')
| -rw-r--r-- | tests/admin_views/tests.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 05e1e242d9..4f6146c344 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -50,7 +50,7 @@ from .models import ( CustomArticle, CyclicOne, CyclicTwo, DooHickey, Employee, EmptyModel, ExternalSubscriber, Fabric, FancyDoodad, FieldOverridePost, FilteredManager, FooAccount, FoodDelivery, FunkyTag, Gallery, Grommet, - Inquisition, Language, MainPrepopulated, ModelWithStringPrimaryKey, + Inquisition, Language, Link, MainPrepopulated, ModelWithStringPrimaryKey, OtherStory, Paper, Parent, ParentWithDependentChildren, Person, Persona, Picture, Pizza, Plot, PlotDetails, PluggableSearchPerson, Podcast, Post, PrePopulatedPost, Promo, Question, Recommendation, Recommender, @@ -4645,6 +4645,22 @@ class ReadonlyTest(TestCase): response = self.client.get(reverse('admin:admin_views_post_change', args=(p.pk,))) self.assertContains(response, "%d amount of cool" % p.pk) + @ignore_warnings(category=RemovedInDjango20Warning) # for allow_tags deprecation + def test_readonly_text_field(self): + p = Post.objects.create( + title="Readonly test", content="test", + readonly_content='test\r\n\r\ntest\r\n\r\ntest\r\n\r\ntest', + ) + Link.objects.create( + url="http://www.djangoproject.com", post=p, + readonly_link_content="test\r\nlink", + ) + response = self.client.get(reverse('admin:admin_views_post_change', args=(p.pk,))) + # Checking readonly field. + self.assertContains(response, 'test<br /><br />test<br /><br />test<br /><br />test') + # Checking readonly field in inline. + self.assertContains(response, 'test<br />link') + def test_readonly_post(self): data = { "title": "Django Got Readonly Fields", |
