def test(self, expected=expected, input=input): expected = ''.join([ token.toxml() for token in html5parser.HTMLParser().parseFragment(expected).childNodes ]) expected = simplejson.loads(simplejson.dumps(expected)) self.assertEqual(expected, self.sanitize_html(input))
def test(self, expected=expected, input=input): expected = ''.join([token.toxml() for token in html5parser.HTMLParser(). parseFragment(expected).childNodes]) expected = simplejson.loads(simplejson.dumps(expected)) self.assertEqual(expected, self.sanitize_html(input))
def normalizeTokens(tokens): # TODO: convert tests to reflect arrays for i, token in enumerate(tokens): if token[0] == u'ParseError': tokens[i] = token[0] return simplejson.loads(simplejson.dumps(tokens))
def test(self, expected=expected, input=input): expected = simplejson.loads(simplejson.dumps(expected)) self.assertEqual(expected, self.sanitize_html(input, strip=strip))