Back to index

plone3  3.1.7
Public Member Functions
Archetypes.tests.test_unicode.UnicodeLinesFieldTest Class Reference
Inheritance diagram for Archetypes.tests.test_unicode.UnicodeLinesFieldTest:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.tests.test_unicode.UnicodeLinesFieldTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_set1
def test_set2

Detailed Description

Definition at line 67 of file test_unicode.py.


Member Function Documentation

Definition at line 69 of file test_unicode.py.

00069 
00070     def test_set1(self):
00071         instance = Dummy()
00072         f = LinesField('test')
00073         f.set(instance, 'h\xc3\xa9h\xc3\xa9h\xc3\xa9')
00074         out = ('h\xc3\xa9h\xc3\xa9h\xc3\xa9',)
00075         iso = ('héhéhé',)
00076         self.failUnlessEqual(f.get(instance), out)
00077         self.failUnlessEqual(f.get(instance, encoding="ISO-8859-1"), iso)
00078         f.set(instance, 'héhéhé', encoding='ISO-8859-1')
00079         self.failUnlessEqual(f.get(instance), out)
00080         self.failUnlessEqual(f.get(instance, encoding="ISO-8859-1"), iso)
00081         f.set(instance, u'héhéhé')
00082         self.failUnlessEqual(f.get(instance), out)
00083         self.failUnlessEqual(f.get(instance, encoding="ISO-8859-1"), iso)

Definition at line 84 of file test_unicode.py.

00084 
00085     def test_set2(self):
00086         instance = Dummy()
00087         f = LinesField('test')
00088         f.set(instance, ['h\xc3\xa9h\xc3\xa9h\xc3\xa9'])
00089         out = ('h\xc3\xa9h\xc3\xa9h\xc3\xa9',)
00090         iso = ('héhéhé',)
00091         self.failUnlessEqual(f.get(instance), out)
00092         self.failUnlessEqual(f.get(instance, encoding="ISO-8859-1"), iso)
00093         f.set(instance, ['héhéhé'], encoding='ISO-8859-1')
00094         self.failUnlessEqual(f.get(instance), out)
00095         self.failUnlessEqual(f.get(instance, encoding="ISO-8859-1"), iso)
00096         f.set(instance, [u'héhéhé'])
00097         self.failUnlessEqual(f.get(instance), out)
00098         self.failUnlessEqual(f.get(instance, encoding="ISO-8859-1"), iso)
00099 


The documentation for this class was generated from the following file: