Changeset 6778
- Timestamp:
- 11/30/07 09:32:01 (1 year ago)
- Files:
-
- django/trunk/django/template/__init__.py (modified) (1 diff)
- django/trunk/tests/regressiontests/templates/unicode.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/template/__init__.py
r6724 r6778 805 805 else: 806 806 bits.append(node) 807 return ''.join([force_unicode(b) for b in bits])807 return mark_safe(''.join([force_unicode(b) for b in bits])) 808 808 809 809 def get_nodes_by_type(self, nodetype): django/trunk/tests/regressiontests/templates/unicode.py
r5876 r6778 4 4 Templates can be created from unicode strings. 5 5 >>> from django.template import * 6 >>> from django.utils.safestring import SafeData 6 7 >>> t1 = Template(u'ŠĐĆŽćžšđ {{ var }}') 7 8 … … 25 26 26 27 Since both templates and all four contexts represent the same thing, they all 27 render the same (and are returned as unicode objects). 28 render the same (and are returned as unicode objects and "safe" objects as 29 well, for auto-escaping purposes). 28 30 29 31 >>> t1.render(c3) == t2.render(c3) 30 32 True 31 >>> type(t1.render(c3)) 32 <type 'unicode'> 33 >>> isinstance(t1.render(c3), unicode) 34 True 35 >>> isinstance(t1.render(c3), SafeData) 36 True 33 37 """
