Exemplo n.º 1
0
 def test_field2ulines_with_string_with_newlines(self):
     from ZPublisher.Converters import field2ulines
     to_convert = u'abc\ndef\nghi'
     self.assertEqual(field2ulines(to_convert), to_convert.splitlines())
Exemplo n.º 2
0
 def test_field2ulines_with_empty_string(self):
     from ZPublisher.Converters import field2ulines
     to_convert = ''
     self.assertEqual(field2ulines(to_convert), [])
Exemplo n.º 3
0
 def test_field2ulines_with_string_no_newlines(self):
     from ZPublisher.Converters import field2ulines
     to_convert = u'abc def ghi'
     self.assertEqual(field2ulines(to_convert), [to_convert])
Exemplo n.º 4
0
 def test_field2ulines_with_string_with_newlines(self):
     from ZPublisher.Converters import field2ulines
     to_convert = u'abc\ndef\nghi'
     self.assertEqual(field2ulines(to_convert), to_convert.splitlines())
Exemplo n.º 5
0
 def test_field2ulines_with_tuple(self):
     from ZPublisher.Converters import field2ulines
     to_convert = (u'one', 'two')
     self.assertEqual(field2ulines(to_convert),
                      [text_type(x) for x in to_convert])
Exemplo n.º 6
0
 def test_field2ulines_with_string_no_newlines(self):
     from ZPublisher.Converters import field2ulines
     to_convert = u'abc def ghi'
     self.assertEqual(field2ulines(to_convert), [to_convert])
Exemplo n.º 7
0
 def test_field2ulines_with_empty_string(self):
     from ZPublisher.Converters import field2ulines
     to_convert = ''
     self.assertEqual(field2ulines(to_convert), [])
Exemplo n.º 8
0
 def test_field2ulines_with_tuple(self):
     from ZPublisher.Converters import field2ulines
     to_convert = (u'one', 'two')
     self.assertEqual(field2ulines(to_convert),
                      [text_type(x) for x in to_convert])
Exemplo n.º 9
0
 def test_field2ulines_with_list(self):
     from ZPublisher.Converters import field2ulines
     to_convert = [u'one', 'two']
     self.assertEqual(field2ulines(to_convert),
                      [unicode(x) for x in to_convert])
Exemplo n.º 10
0
 def test_field2ulines_with_list(self):
     from ZPublisher.Converters import field2ulines
     to_convert = ['one', 'two']
     self.assertEqual(field2ulines(to_convert),
                      [str(x) for x in to_convert])