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:
@@ -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 “quotes” 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
|
||||
|
||||
Reference in New Issue
Block a user