Exemple #1
0
 def test_htmlencoding_nonentities(self):
     """tests to give us full coverage"""
     for encoded, real in [("Some &; text", "Some &; text"),
                           ("&copy ", "&copy "),
                           ("&rogerrabbit;", "&rogerrabbit;"),
                          ]:
         assert quote.htmlentitydecode(encoded) == real
Exemple #2
0
 def test_htmlencoding_nonentities(self):
     """tests to give us full coverage"""
     for encoded, real in [(u"Some &; text", u"Some &; text"),
                           (u"&copy ", u"&copy "),
                           (u"&rogerrabbit;", u"&rogerrabbit;"),
                          ]:
         assert quote.htmlentitydecode(encoded) == real
Exemple #3
0
    def test_htmlencoding_nonentities():
        """tests to give us full coverage"""
        for encoded, real in [
            ("Some &; text", "Some &; text"),
            ("&copy ", "&copy "),
            ("&copy", "&copy"),
            ("&rogerrabbit;", "&rogerrabbit;"),
        ]:
            assert quote.htmlentitydecode(encoded) == real

        for decoded, real in [
            ("Some &; text", "Some &; text"),
            ("&copy ", "&copy "),
            ("&copy", "&copy"),
            ("&rogerrabbit;", "&rogerrabbit;"),
        ]:
            assert quote.htmlentityencode(decoded) == real
Exemple #4
0
 def _html_encoding_helper(pairs):
     for from_, to in pairs:
         assert quote.htmlentityencode(from_) == to
         assert quote.htmlentitydecode(to) == from_
Exemple #5
0
 def _html_encoding_helper(self, pairs):
     for from_, to in pairs:
         assert quote.htmlentityencode(from_) == to
         assert quote.htmlentitydecode(to) == from_
Exemple #6
0
 def test_htmlencoding(self):
     """test that we can encode and decode HTML entities"""
     raw_encoded = [(u"€", "€"), (u"©", "©"), (u'"', """)]
     for raw, encoded in raw_encoded:
         assert quote.htmlentityencode(raw) == encoded
         assert quote.htmlentitydecode(encoded) == raw
Exemple #7
0
 def test_htmlencoding(self):
     """test that we can encode and decode HTML entities"""
     raw_encoded = [(u"€", "€"), (u"©", "©"), (u'"', """)]
     for raw, encoded in raw_encoded:
         assert quote.htmlentityencode(raw) == encoded
         assert quote.htmlentitydecode(encoded) == raw