Code

Ticket #10843: ticket10843.diff

File ticket10843.diff, 1.0 KB (added by arthurk, 5 years ago)
Line 
1diff -r 571ef27dfd73 django/contrib/markup/tests.py
2--- a/django/contrib/markup/tests.py    Sun May 10 09:22:53 2009 +0000
3+++ b/django/contrib/markup/tests.py    Sun May 10 13:45:41 2009 +0200
4@@ -22,9 +22,17 @@
5         t = Template("{{ textile_content|textile }}")
6         rendered = t.render(Context(locals())).strip()
7         if textile:
8-            self.assertEqual(rendered, """<p>Paragraph 1</p>
9+            # textile versions prior to 2.1.0 don't add a '\t' char before
10+            # the second paragraph
11+            if(int(textile.__version__.split('.')[1]) > 0):
12+                expected_output = """<p>Paragraph 1</p>
13 
14-<p>Paragraph 2 with &#8220;quotes&#8221; and <code>code</code></p>""")
15+\t<p>Paragraph 2 with &#8220;quotes&#8221; and <code>code</code></p>"""
16+            else:
17+                expected_output = """<p>Paragraph 1</p>
18+
19+<p>Paragraph 2 with &#8220;quotes&#8221; and <code>code</code></p>"""
20+            self.assertEqual(rendered, expected_output)
21         else:
22             self.assertEqual(rendered, escape(textile_content))
23