Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def test_store
def test_getRaw
def test_transform

Public Attributes

 instance
 bu

Detailed Description

Definition at line 116 of file test_unicode.py.


Member Function Documentation

Definition at line 118 of file test_unicode.py.

00118 
00119     def afterSetUp(self):
00120         self.instance = Dummy()
00121         self.bu = BaseUnit('test', 'héhéhé', self.instance,
00122                            mimetype='text/plain', encoding='ISO-8859-1')

check bu.getRaw return the ustring encoded with the default charset
or the specified one if any

Definition at line 127 of file test_unicode.py.

00127 
00128     def test_getRaw(self):
00129         """check bu.getRaw return the ustring encoded with the default charset
00130         or the specified one if any
00131         """
00132         self.failUnlessEqual(self.bu.getRaw(), 'h\xc3\xa9h\xc3\xa9h\xc3\xa9')
00133         self.failUnlessEqual(self.bu.getRaw('ISO-8859-1'), 'héhéhé')

check non binary string are stored as unicode

Definition at line 123 of file test_unicode.py.

00123 
00124     def test_store(self):
00125         """check non binary string are stored as unicode"""
00126         self.failUnless(type(self.bu.raw) is type(u''))

check the string given to the transformer is encoded using its
original encoding, and finally returned using the default charset

Definition at line 134 of file test_unicode.py.

00134 
00135     def test_transform(self):
00136         """check the string given to the transformer is encoded using its
00137         original encoding, and finally returned using the default charset
00138         """
00139         self.instance.aq_parent = None
00140         self.instance.portal_transforms = FakeTransformer('héhéhé')
00141         transformed = self.bu.transform(self.instance, 'text/plain')
00142         self.failUnlessEqual(transformed, 'h\xc3\xa9h\xc3\xa9h\xc3\xa9')
00143 


Member Data Documentation

Definition at line 120 of file test_unicode.py.

Definition at line 119 of file test_unicode.py.


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