mirror of https://github.com/scrapy/scrapy.git
fixed bug in previous commit
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%401013
This commit is contained in:
parent
0c9631594d
commit
d8c0440700
|
|
@ -87,7 +87,7 @@ class Request(object):
|
|||
"""Create a new Request with the same attributes except for those
|
||||
given new values.
|
||||
"""
|
||||
return self.__class__(url=self.url if url is None else self.url,
|
||||
return self.__class__(url=self.url if url is None else url,
|
||||
callback=callback,
|
||||
method=self.method if method is None else method,
|
||||
headers=copy.deepcopy(self.headers) if headers is None else headers,
|
||||
|
|
|
|||
|
|
@ -156,7 +156,8 @@ class RequestTest(unittest.TestCase):
|
|||
|
||||
# Empty attributes (which may fail if not compared properly)
|
||||
r3 = Request("http://www.example.com", meta={'a': 1}, dont_filter=True)
|
||||
r4 = r3.replace(body='', meta={}, dont_filter=False)
|
||||
r4 = r3.replace(url="http://www.example.com/2", body='', meta={}, dont_filter=False)
|
||||
self.assertEqual(r4.url, "http://www.example.com/2")
|
||||
self.assertEqual(r4.body, '')
|
||||
self.assertEqual(r4.meta, {})
|
||||
assert r4.dont_filter is False
|
||||
|
|
|
|||
Loading…
Reference in New Issue