mirror of https://github.com/scrapy/scrapy.git
PY3 fix AjacCrawlable middleware tests
This commit is contained in:
parent
b876755f1c
commit
45101829a5
|
|
@ -6,7 +6,6 @@ tests/test_exporters.py
|
|||
tests/test_linkextractors_deprecated.py
|
||||
tests/test_crawl.py
|
||||
tests/test_downloader_handlers.py
|
||||
tests/test_downloadermiddleware_ajaxcrawlable.py
|
||||
tests/test_downloadermiddleware_defaultheaders.py
|
||||
tests/test_downloadermiddleware_downloadtimeout.py
|
||||
tests/test_downloadermiddleware_httpauth.py
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class AjaxCrawlMiddlewareTest(unittest.TestCase):
|
|||
self.mw = AjaxCrawlMiddleware.from_crawler(crawler)
|
||||
|
||||
def _ajaxcrawlable_body(self):
|
||||
return '<html><head><meta name="fragment" content="!"/></head><body></body></html>'
|
||||
return b'<html><head><meta name="fragment" content="!"/></head><body></body></html>'
|
||||
|
||||
def _req_resp(self, url, req_kwargs=None, resp_kwargs=None):
|
||||
req = Request(url, **(req_kwargs or {}))
|
||||
|
|
@ -53,6 +53,6 @@ class AjaxCrawlMiddlewareTest(unittest.TestCase):
|
|||
assert resp3 is resp2
|
||||
|
||||
def test_noncrawlable_body(self):
|
||||
req, resp = self._req_resp('http://example.com/', {}, {'body': '<html></html>'})
|
||||
req, resp = self._req_resp('http://example.com/', {}, {'body': b'<html></html>'})
|
||||
resp2 = self.mw.process_response(req, resp, self.spider)
|
||||
self.assertIs(resp, resp2)
|
||||
|
|
|
|||
Loading…
Reference in New Issue