def test_charrefRepr(self): """ L{CharRef.__repr__} returns a value which makes it easy to see what character is referred to. """ snowman = ord(u"\N{SNOWMAN}") self.assertEqual(repr(CharRef(snowman)), "CharRef(9731)")
def test_serializeCharRef(self): """ A character reference is flattened to a string using the I{&#NNNN;} syntax. """ ref = CharRef(ord("\N{SNOWMAN}")) return self.assertFlattensTo(ref, b"☃")
def test_serializeCharRef(self) -> None: """ A character reference is flattened to a string using the I{&#NNNN;} syntax. """ ref = CharRef(ord("\N{SNOWMAN}")) self.assertFlattensImmediately(ref, b"☃")