1
0
mirror of https://github.com/django/django.git synced 2025-07-04 01:39:20 +00:00

unicode: Fixed a dubious test construct.

git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5343 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2007-05-25 10:36:14 +00:00
parent 7ba850af3b
commit d5280e72d3

View File

@ -69,10 +69,10 @@ class OtherClass:
def method(self):
return "OtherClass.method"
class UnicodeInStrClass:
"Class whose __str__ returns a Unicode object."
class UTF8Class:
"Class whose __str__ returns non-ASCII data"
def __str__(self):
return u'ŠĐĆŽćžšđ'
return u'ŠĐĆŽćžšđ'.encode('utf-8')
class Templates(unittest.TestCase):
def test_templates(self):
@ -223,7 +223,7 @@ class Templates(unittest.TestCase):
# Make sure that any unicode strings are converted to bytestrings
# in the final output.
'filter-syntax18': (r'{{ var }}', {'var': UnicodeInStrClass()}, '\xc5\xa0\xc4\x90\xc4\x86\xc5\xbd\xc4\x87\xc5\xbe\xc5\xa1\xc4\x91'),
'filter-syntax18': (r'{{ var }}', {'var': UTF8Class()}, '\xc5\xa0\xc4\x90\xc4\x86\xc5\xbd\xc4\x87\xc5\xbe\xc5\xa1\xc4\x91'),
### COMMENT SYNTAX ########################################################
'comment-syntax01': ("{# this is hidden #}hello", {}, "hello"),