diff --git a/scrapy/tests/test_selector.py b/scrapy/tests/test_selector.py index 97639d269..6fbb451a6 100644 --- a/scrapy/tests/test_selector.py +++ b/scrapy/tests/test_selector.py @@ -46,6 +46,15 @@ class SelectorTestCase(unittest.TestCase): ["".format(40 * 'b')] ) + def test_representation_unicode_query(self): + body = u"

".format(50 * 'b') + response = TextResponse(url="http://example.com", body=body, encoding='utf8') + sel = self.sscls(response) + self.assertEqual( + map(repr, sel.xpath(u'//input[@value="\xa9"]/@value')), + [""] + ) + def test_select_unicode_query(self): body = u"

" response = TextResponse(url="http://example.com", body=body, encoding='utf8')