/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to loggerhead/tests/test_simple.py

  • Committer: Jelmer Vernooij
  • Date: 2018-10-20 16:16:22 UTC
  • mto: (491.6.1 breezy)
  • mto: This revision was merged to the branch mainline in revision 494.
  • Revision ID: jelmer@jelmer.uk-20181020161622-r41ztfgd2lzjpw2f
Finish python 3 port.

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
        # '<span class='pyg-n'>with</span><span class='pyg-o'>&lt;</span>'
124
124
        # '<span class='pyg-n'>htmlspecialchars</span>
125
125
        # So we pre-filter the body, to make sure remove spans of that type.
126
 
        body_no_span = re.sub(r'<span class="pyg-.">', '', res.body)
127
 
        body_no_span = body_no_span.replace('</span>', '')
 
126
        body_no_span = re.sub(b'<span class="pyg-.">', b'', res.body)
 
127
        body_no_span = body_no_span.replace(b'</span>', b'')
128
128
        for line in self.filecontents.splitlines():
129
 
            escaped = cgi.escape(line)
 
129
            escaped = cgi.escape(line).encode('utf-8')
130
130
            self.assertTrue(escaped in body_no_span,
131
131
                            "did not find %r in %r" % (escaped, body_no_span))
132
132