'Test that unicode is encoded correctly in the appropriate places, and
raises an error when it occurs in inappropriate place.'

def test_serializeUnicode(self):

    snowman = u'\u2603'
    return gatherResults([self.assertFlattensTo(snowman, '\xe2\x98\x83'), self.assertFlattensTo(tags.p(snowman), '<p>\xe2\x98\x83</p>'), self.assertFlattensTo(Comment(snowman), '<!--\xe2\x98\x83-->'), self.assertFlattensTo(CDATA(snowman), '<![CDATA[\xe2\x98\x83]]>'), self.assertFlatteningRaises(Tag(snowman), UnicodeEncodeError), self.assertFlatteningRaises(Tag('p', attributes={snowman: ''}), UnicodeEncodeError)])
