mirror of https://github.com/scrapy/scrapy.git
remove python 2 reminiscence in cookies
This commit is contained in:
parent
38496a00b7
commit
0e0d1ad643
|
|
@ -186,9 +186,6 @@ class WrappedResponse:
|
|||
def info(self):
|
||||
return self
|
||||
|
||||
# python3 cookiejars calls get_all
|
||||
def get_all(self, name, default=None):
|
||||
return [to_unicode(v, errors='replace')
|
||||
for v in self.response.headers.getlist(name)]
|
||||
# python2 cookiejars calls getheaders
|
||||
getheaders = get_all
|
||||
|
|
|
|||
|
|
@ -64,9 +64,6 @@ class WrappedResponseTest(TestCase):
|
|||
def test_info(self):
|
||||
self.assertIs(self.wrapped.info(), self.wrapped)
|
||||
|
||||
def test_getheaders(self):
|
||||
self.assertEqual(self.wrapped.getheaders('content-type'), ['text/html'])
|
||||
|
||||
def test_get_all(self):
|
||||
# get_all result must be native string
|
||||
self.assertEqual(self.wrapped.get_all('content-type'), ['text/html'])
|
||||
|
|
|
|||
Loading…
Reference in New Issue