diff -r 2e0b0af889be -r a04b1e4126c4 thirdparty/google_appengine/lib/django/tests/regressiontests/markup/tests.py --- a/thirdparty/google_appengine/lib/django/tests/regressiontests/markup/tests.py Sun Sep 06 23:31:53 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -# Quick tests for the markup templatetags (django.contrib.markup) - -from django.template import Template, Context, add_to_builtins -import re -import unittest - -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

""") - else: - self.assertEqual(rendered, textile_content) - - def test_markdown(self): - try: - import markdown - except ImportError: - markdown = None - - markdown_content = """Paragraph 1 - -## An h2""" - - t = Template("{{ markdown_content|markdown }}") - rendered = t.render(Context(locals())).strip() - if markdown: - pattern = re.compile("""

Paragraph 1\s*

\s*

\s*An h2

""") - self.assert_(pattern.match(rendered)) - else: - self.assertEqual(rendered, markdown_content) - - def test_docutils(self): - try: - import docutils - except ImportError: - docutils = None - - rest_content = """Paragraph 1 - -Paragraph 2 with a link_ - -.. _link: http://www.example.com/""" - - t = Template("{{ rest_content|restructuredtext }}") - rendered = t.render(Context(locals())).strip() - if docutils: - self.assertEqual(rendered, """

Paragraph 1

-

Paragraph 2 with a link

""") - else: - self.assertEqual(rendered, rest_content) - - -if __name__ == '__main__': - unittest.main()