

def test_ajaxcrawl_loop(self):
    (req, resp) = self._req_resp('http://example.com/', {
        
    }, {
        'body': self._ajaxcrawlable_body(),
    })
    req2 = self.mw.process_response(req, resp, self.spider)
    resp2 = HtmlResponse(req2.url, body=resp.body, request=req2)
    resp3 = self.mw.process_response(req2, resp2, self.spider)
    assert isinstance(resp3, HtmlResponse), (resp3.__class__, resp3)
    self.assertEqual(resp3.request.url, 'http://example.com/?_escaped_fragment_=')
    assert (resp3 is resp2)

dataset/ETHPy150Open scrapy/scrapy/tests/test_downloadermiddleware_ajaxcrawlable.py AjaxCrawlMiddlewareTest.test_ajaxcrawl_loop/original