mirror of https://github.com/scrapy/scrapy.git
fix tests after changes introduced by scrapy/w3lib#21
This commit is contained in:
parent
65f69e1609
commit
2ba78e715b
|
|
@ -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"""
|
||||
|
|
|
|||
|
|
@ -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_='
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue