From 5bf10cc8ffd54e20199a8d58a861541605fde2f1 Mon Sep 17 00:00:00 2001 From: Paul Tremberth Date: Thu, 7 Apr 2016 22:43:47 +0200 Subject: [PATCH] Fix tests on URL path encoding for links from latin1 document UTF-8 is to be used for path component. Page encoding only affects query part of URLs. --- tests/test_linkextractors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_linkextractors.py b/tests/test_linkextractors.py index d78b25f25..b946ef842 100644 --- a/tests/test_linkextractors.py +++ b/tests/test_linkextractors.py @@ -80,8 +80,8 @@ class LinkExtractorTestCase(unittest.TestCase): ]) self.assertEqual(lx.extract_links(response_latin1), [ - Link(url='http://example.com/sample_%F1.html', text=''), - Link(url='http://example.com/sample_%E1.html', text='sample \xe1 text'.decode('latin1')), + Link(url='http://example.com/sample_%C3%B1.html', text=''), + Link(url='http://example.com/sample_%C3%A1.html', text='sample \xe1 text'.decode('latin1')), ]) def test_matches(self):