def test_to_xml_no_encoding(self): b = Behavior() b.description = UNICODE_STR xml = b.to_xml(encoding=None) self.assertTrue(isinstance(xml, unicode)) self.assertTrue(UNICODE_STR in xml)
def test_to_xml_default_encoded(self): b = Behavior() b.description = UNICODE_STR xml = b.to_xml() self.assertTrue(UNICODE_STR in xml.decode('utf-8'))
def test_to_xml_utf16_encoded(self): encoding = 'utf-16' b = Behavior() b.description = UNICODE_STR xml = b.to_xml(encoding=encoding) self.assertTrue(UNICODE_STR in xml.decode(encoding))
def test_to_xml_no_encoding(self): b = Behavior() b.description = UNICODE_STR xml = b.to_xml(encoding=None) self.assertTrue(isinstance(xml, text_type)) self.assertTrue(UNICODE_STR in xml)