Пример #1
0
 def test_field2string_with_filelike_object(self):
     from ZPublisher.Converters import field2string
     to_convert = 'to_convert'
     class Filelike:
         def read(self):
             return to_convert
     self.assertEqual(field2string(Filelike()), to_convert)
Пример #2
0
    def test_field2string_with_filelike_object(self):
        from ZPublisher.Converters import field2string
        to_convert = 'to_convert'

        class Filelike:
            def read(self):
                return to_convert

        self.assertEqual(field2string(Filelike()), to_convert)
Пример #3
0
 def test_field2string_with_unicode_default_encoding(self):
     from ZPublisher.Converters import field2string
     to_convert = u'to_convert'
     expected = 'to_convert'
     self.assertEqual(field2string(to_convert), expected)
Пример #4
0
 def test_field2string_with_string(self):
     from ZPublisher.Converters import field2string
     to_convert = 'to_convert'
     self.assertEqual(field2string(to_convert), to_convert)
Пример #5
0
 def test_field2string_with_unicode_default_encoding(self):
     from ZPublisher.Converters import field2string
     to_convert = u'to_convert'
     expected = 'to_convert'
     self.assertEqual(field2string(to_convert), expected)
Пример #6
0
 def test_field2string_with_string(self):
     from ZPublisher.Converters import field2string
     to_convert = 'to_convert'
     self.assertEqual(field2string(to_convert), to_convert)
Пример #7
0
 def test_field2string_with_unicode_default_encoding(self):
     from ZPublisher.Converters import field2string
     to_convert = u'to_convert'
     self.assertEqual(field2string(to_convert),
                      to_convert.encode('iso-8859-15'))
 def test_field2string_with_unicode_default_encoding(self):
     from ZPublisher.Converters import field2string
     to_convert = u'to_convert'
     self.assertEqual(field2string(to_convert),
                      to_convert.encode('iso-8859-15'))