Fix getting pastebin paste visiblity
Pastebin somehow decided to use title instead of alt. They are wrong. That attribute should at least tell "Private" or "Public" to blind users. Well, another reason to use Weboob instead of their website!
This commit is contained in:
parent
0cf736f10d
commit
ce6d9bdcd7
2 changed files with 3 additions and 1 deletions
|
|
@ -51,7 +51,7 @@ class PastePage(LoginPage):
|
|||
paste.contents = self.parser.select(self.document.getroot(),
|
||||
'//textarea[@id="paste_code"]', 1, 'xpath').text
|
||||
visibility_text = self.parser.select(header,
|
||||
'//div[@class="paste_box_line1"]//img', 1, 'xpath').attrib['alt']
|
||||
'//div[@class="paste_box_line1"]//img', 1, 'xpath').attrib['title']
|
||||
if visibility_text.startswith('Public'):
|
||||
paste.public = True
|
||||
elif visibility_text.startswith('Private'):
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ class PastebinTest(BackendTest):
|
|||
p1 = self.backend.new_paste(None, title='ouiboube', contents=u'Weboob <test>¿¡', public=False)
|
||||
self.backend.post_paste(p1, max_age=600)
|
||||
assert p1.id
|
||||
# not related to testing special chars, but check if the paste is
|
||||
# really private since test_post() tests the contrary
|
||||
assert p1.public is False
|
||||
|
||||
# this should use the raw method to get the contents
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue