diff -r 57b4279d8c4e -r 03e267d67478 app/django/contrib/markup/tests.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/django/contrib/markup/tests.py Fri Jul 18 18:22:23 2008 +0000 @@ -0,0 +1,78 @@ +# Quick tests for the markup templatetags (django.contrib.markup) + +import re +import unittest + +from django.template import Template, Context, add_to_builtins +from django.utils.html import escape + +add_to_builtins('django.contrib.markup.templatetags.markup') + +class Templates(unittest.TestCase): + def test_textile(self): + try: + import textile + except ImportError: + textile = None + + textile_content = """Paragraph 1 + +Paragraph 2 with "quotes" and @code@""" + + t = Template("{{ textile_content|textile }}") + rendered = t.render(Context(locals())).strip() + if textile: + self.assertEqual(rendered, """
Paragraph 1
+ +Paragraph 2 with “quotes” and code
Paragraph 1\s*
\s*Paragraph 1
+Paragraph 2 with a link
""") + except AssertionError, e: + # Docutils from SVN (which will become 0.5) + self.assertEqual(rendered, """Paragraph 1
+Paragraph 2 with a link
""") + else: + self.assertEqual(rendered, rest_content) + + +if __name__ == '__main__': + unittest.main()