1
0
mirror of https://github.com/django/django.git synced 2025-10-26 23:26:08 +00:00

Fixed #911 -- Made template system scoped to the parser instead of the template module. Also changed the way tags/filters are registered and added support for multiple arguments to {% load %} tag. Thanks, rjwittams. This is a backwards-incompatible change for people who've created custom template tags or filters. See http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges for upgrade instructions.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1443 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2005-11-26 22:46:31 +00:00
parent 5676d5b068
commit 3ede006fc9
33 changed files with 781 additions and 582 deletions

View File

@@ -1,19 +1,20 @@
# Quick tests for the markup templatetags (django.contrib.markup)
from django.core.template import Template, Context
import django.contrib.markup.templatetags.markup # this registers the filters
from django.core.template import Template, Context, add_to_builtins
add_to_builtins('django.contrib.markup.templatetags.markup')
# find out if markup modules are installed and tailor the test appropriately
try:
import textile
except ImportError:
textile = None
try:
import markdown
except ImportError:
markdown = None
try:
import docutils
except ImportError:
@@ -36,7 +37,7 @@ if textile:
<p>Paragraph 2 with &#8220;quotes&#8221; and <code>code</code></p>"""
else:
assert rendered == textile_content
### test markdown
markdown_content = """Paragraph 1
@@ -64,4 +65,4 @@ if docutils:
assert rendered =="""<p>Paragraph 1</p>
<p>Paragraph 2 with a <a class="reference" href="http://www.example.com/">link</a></p>"""
else:
assert rendered == rest_content
assert rendered == rest_content