diff options
author | R. Tyler Ballance <tyler@monkeypox.org> | 2009-10-14 19:52:34 -0700 |
---|---|---|
committer | R. Tyler Ballance <tyler@monkeypox.org> | 2009-10-14 19:56:05 -0700 |
commit | e8d6782076e0d582d0090c7cef6239f6d72efcd0 (patch) | |
tree | 14d0e116d95d228697ac7035273dabf9b10295bc /cheetah/Tests | |
parent | 9ac5e4c6ed36c3b6b1bc8340fdb69d32db9d98c4 (diff) | |
download | python-cheetah-e8d6782076e0d582d0090c7cef6239f6d72efcd0.tar.gz |
Correctly use cStringIO which only deals in bytestrings.
I'm uncertain if there's any lossiness in encoding a unicode()
object 'utf-8' prior to writing to the stream, but this does
appear to inadvertantly fix another issue we had with mixing UTF-8
encoded strings and unicode() objects when filling a template.
Diffstat (limited to 'cheetah/Tests')
-rw-r--r-- | cheetah/Tests/Unicode.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cheetah/Tests/Unicode.py b/cheetah/Tests/Unicode.py index e4499d9..d627503 100644 --- a/cheetah/Tests/Unicode.py +++ b/cheetah/Tests/Unicode.py @@ -168,15 +168,14 @@ class Unicode_in_SearchList_Test(CommandLineTest): 'adjective' : u'\u0e22\u0e34\u0e19\u0e14\u0e35\u0e15\u0e49\u0e2d\u0e19\u0e23\u0e31\u0e1a'}]) assert template.respond() - def test_ErrorReporting(self): + def test_Thai_utf8(self): utf8 = '\xe0\xb8\xa2\xe0\xb8\xb4\xe0\xb8\x99\xe0\xb8\x94\xe0\xb8\xb5\xe0\xb8\x95\xe0\xb9\x89\xe0\xb8\xad\xe0\xb8\x99\xe0\xb8\xa3\xe0\xb8\xb1\xe0\xb8\x9a' source = '''This is $adjective''' template = self.createAndCompile(source) assert template and issubclass(template, Template) template = template(searchList=[{'adjective' : utf8}]) - self.failUnlessRaises(DummyTransaction.DummyResponseFailure, template.respond) - + assert template.respond() if __name__ == '__main__': |