fix login
This commit is contained in:
parent
cb90621100
commit
0985ab7062
2 changed files with 8 additions and 2 deletions
|
|
@ -103,10 +103,10 @@ class AuMBrowser(BaseBrowser):
|
|||
self.page.login(self.username, self.password)
|
||||
|
||||
def is_logged(self):
|
||||
return not self.is_on_page(LoginPage)
|
||||
return self.page and self.page.is_logged()
|
||||
|
||||
def home(self):
|
||||
return self.location('http://www.adopteunmec.com/')
|
||||
return self.location('http://www.adopteunmec.com/index.php')
|
||||
|
||||
def pageaccess(func):
|
||||
def inner(self, *args, **kwargs):
|
||||
|
|
|
|||
|
|
@ -37,6 +37,12 @@ class PageBase(BasePage):
|
|||
if img.getAttribute('src') == 'http://s.adopteunmec.com/img/exemple.jpg':
|
||||
raise AdopteBanned('Your account is blocked. You have to unblock by yourself but we can\'t help you.')
|
||||
|
||||
def is_logged(self):
|
||||
for form in self.browser.forms():
|
||||
if form.name == 'form_login':
|
||||
return False
|
||||
return True
|
||||
|
||||
def open_contact_list_page(self):
|
||||
self.browser.follow_link(url_regex=r"/mail.php$")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue