1
0
mirror of https://github.com/django/django.git synced 2025-10-25 14:46:09 +00:00

unicode: Converted the template output and database I/O interfaces to

understand unicode strings. All tests pass (except for one commented out with
"XFAIL"), but untested with database servers using non-UTF8, non-ASCII on the
server.


git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@4971 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2007-04-09 10:33:57 +00:00
parent 232b7ac519
commit b493b7e3cf
21 changed files with 308 additions and 117 deletions

View File

@@ -11,8 +11,14 @@ from django.template import loader
from django.utils.translation import activate, deactivate, install
from django.utils.tzinfo import LocalTimezone
from datetime import datetime, timedelta
from unicode import unicode_tests
import unittest
# Some other tests we would like to run
__test__ = {
'unicode': unicode_tests,
}
#################################
# Custom template tag for tests #
#################################
@@ -202,8 +208,8 @@ class Templates(unittest.TestCase):
# Empty strings can be passed as arguments to filters
'basic-syntax36': (r'{{ var|join:"" }}', {'var': ['a', 'b', 'c']}, 'abc'),
# If a variable has a __str__() that returns a Unicode object, the value
# will be converted to a bytestring.
# Make sure that any unicode strings are converted to bytestrings
# in the final output.
'basic-syntax37': (r'{{ var }}', {'var': UnicodeInStrClass()}, '\xc5\xa0\xc4\x90\xc4\x86\xc5\xbd\xc4\x87\xc5\xbe\xc5\xa1\xc4\x91'),
### COMMENT SYNTAX ########################################################