def test_field2bytes_with_text(self): from ZPublisher.Converters import field2bytes to_convert = u'to_convert' expected = b'to_convert' self.assertEqual(field2bytes(to_convert), expected)
def test_field2bytes_with_bytes(self): from ZPublisher.Converters import field2bytes to_convert = b'to_convert' self.assertEqual(field2bytes(to_convert), to_convert)