'Test restrict_xpaths with encodings'

def test_process_value(self):

    html = '\n                                                <a    href="javascript:goToPage(\'../other/page.html\',\'photo\',\'width=600,height=540,scrollbars\');    return    false">Link    text</a>\n                                                <a    href="/about.html">About    us</a>\n                                                '
    response = HtmlResponse('http://example.org/somepage/index.html', body=html, encoding='windows-1252')
    def process_value(value):
        m = re.search("javascript:goToPage\\('(.*?)'", value)
        if m:
            return m.group(1)
    lx = self.extractor_cls(process_value=process_value)
    self.assertEqual(lx.extract_links(response), [Link(url='http://example.org/other/page.html', text='Link    text')])
