def test_serializeCDATA(self):
        """
        Test that CDATA is correctly flattened and escaped.
        """
        return gatherResults([
            self.assertFlattensTo(CDATA('foo bar'), b'<![CDATA[foo bar]]>'),
            self.assertFlattensTo(
                CDATA('foo ]]> bar'),
                b'<![CDATA[foo ]]]]><![CDATA[> bar]]>'),
        ])

        Test that CDATA is correctly flattened and escaped.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_flatten.py