Commit 91187746 authored by Martijn Pieters's avatar Martijn Pieters

Add simple unicode test.

parent 22843d77
...@@ -80,6 +80,27 @@ class ProcessInputsTests(unittest.TestCase): ...@@ -80,6 +80,27 @@ class ProcessInputsTests(unittest.TestCase):
self.assertEquals(req['num'], 42) self.assertEquals(req['num'], 42)
self.assertEquals(req['words'], 'Some words') self.assertEquals(req['words'], 'Some words')
def testUnicodeConversions(self):
inputs = (('ustring:ustring:utf8', 'test\xc2\xae'),
('utext:utext:utf8', 'test\xc2\xae\ntest\xc2\xae\n'),
('utokens:utokens:utf8', 'test\xc2\xae test\xc2\xae'),
('ulines:ulines:utf8', 'test\xc2\xae\ntest\xc2\xae'),
('nouconverter:string:utf8', 'test\xc2\xae'))
req = self._processInputs(inputs)
formkeys = list(req.form.keys())
formkeys.sort()
self.assertEquals(formkeys, ['nouconverter', 'ulines', 'ustring',
'utext', 'utokens'])
self.assertEquals(req['ustring'], u'test\u00AE')
self.assertEquals(req['utext'], u'test\u00AE\ntest\u00AE\n')
self.assertEquals(req['utokens'], [u'test\u00AE', u'test\u00AE'])
self.assertEquals(req['ulines'], [u'test\u00AE', u'test\u00AE'])
self.assertEquals(req['nouconverter'], 'test\xae')
def testSimpleContainers(self): def testSimpleContainers(self):
inputs = ( inputs = (
('oneitem:list', 'one'), ('oneitem:list', 'one'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment