From 2ba78e715b761628eaa346cde60cecfbbbdce222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Mon, 2 Jun 2014 16:57:59 +0000 Subject: [PATCH] fix tests after changes introduced by scrapy/w3lib#21 --- scrapy/tests/test_http_request.py | 4 ++-- scrapy/utils/url.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrapy/tests/test_http_request.py b/scrapy/tests/test_http_request.py index e438a51ce..ebcee8c1d 100644 --- a/scrapy/tests/test_http_request.py +++ b/scrapy/tests/test_http_request.py @@ -108,10 +108,10 @@ class RequestTest(unittest.TestCase): def test_ajax_url(self): # ascii url r = self.request_class(url="http://www.example.com/ajax.html#!key=value") - self.assertEqual(r.url, "http://www.example.com/ajax.html?_escaped_fragment_=key=value") + self.assertEqual(r.url, "http://www.example.com/ajax.html?_escaped_fragment_=key%3Dvalue") # unicode url r = self.request_class(url=u"http://www.example.com/ajax.html#!key=value") - self.assertEqual(r.url, "http://www.example.com/ajax.html?_escaped_fragment_=key=value") + self.assertEqual(r.url, "http://www.example.com/ajax.html?_escaped_fragment_=key%3Dvalue") def test_copy(self): """Test Request copy""" diff --git a/scrapy/utils/url.py b/scrapy/utils/url.py index 9a12aa26b..3c86a6edb 100644 --- a/scrapy/utils/url.py +++ b/scrapy/utils/url.py @@ -82,11 +82,11 @@ def escape_ajax(url): http://code.google.com/web/ajaxcrawling/docs/getting-started.html >>> escape_ajax("www.example.com/ajax.html#!key=value") - 'www.example.com/ajax.html?_escaped_fragment_=key=value' + 'www.example.com/ajax.html?_escaped_fragment_=key%3Dvalue' >>> escape_ajax("www.example.com/ajax.html?k1=v1&k2=v2#!key=value") - 'www.example.com/ajax.html?k1=v1&k2=v2&_escaped_fragment_=key=value' + 'www.example.com/ajax.html?k1=v1&k2=v2&_escaped_fragment_=key%3Dvalue' >>> escape_ajax("www.example.com/ajax.html?#!key=value") - 'www.example.com/ajax.html?_escaped_fragment_=key=value' + 'www.example.com/ajax.html?_escaped_fragment_=key%3Dvalue' >>> escape_ajax("www.example.com/ajax.html#!") 'www.example.com/ajax.html?_escaped_fragment_='