mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +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:
parent
7ba850af3b
commit
d5280e72d3
@ -69,10 +69,10 @@ class OtherClass:
|
|||||||
def method(self):
|
def method(self):
|
||||||
return "OtherClass.method"
|
return "OtherClass.method"
|
||||||
|
|
||||||
class UnicodeInStrClass:
|
class UTF8Class:
|
||||||
"Class whose __str__ returns a Unicode object."
|
"Class whose __str__ returns non-ASCII data"
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return u'ŠĐĆŽćžšđ'
|
return u'ŠĐĆŽćžšđ'.encode('utf-8')
|
||||||
|
|
||||||
class Templates(unittest.TestCase):
|
class Templates(unittest.TestCase):
|
||||||
def test_templates(self):
|
def test_templates(self):
|
||||||
@ -223,7 +223,7 @@ class Templates(unittest.TestCase):
|
|||||||
|
|
||||||
# Make sure that any unicode strings are converted to bytestrings
|
# Make sure that any unicode strings are converted to bytestrings
|
||||||
# in the final output.
|
# 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 SYNTAX ########################################################
|
||||||
'comment-syntax01': ("{# this is hidden #}hello", {}, "hello"),
|
'comment-syntax01': ("{# this is hidden #}hello", {}, "hello"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user