def test_parse_url(self): self.assertEqual(urls.clean('http://foo.com'), 'http://foo.com/') self.assertEqual(urls.clean('http://foo.com/#lala'), 'http://foo.com/') self.assertEqual(urls.clean('http://foo.com?b=1&a=2'), 'http://foo.com/?a=2&b=1') self.assertEqual(urls.clean('http://FOO.com'), 'http://foo.com/') self.assertEqual(urls.clean('http://FOO.com/A'), 'http://foo.com/A')
def source_url(self): return urls.clean(self.meta.get('source_url'))
def source_url(self, source_url): self.meta['source_url'] = urls.clean(source_url) self.update_meta()