do not crash when there is no full list page

This commit is contained in:
Romain Bignon 2013-10-12 12:25:34 +02:00
commit 1c71ab7a76
2 changed files with 8 additions and 4 deletions

View file

@ -88,10 +88,11 @@ class BanquePopulaire(BaseBrowser):
if self.page.is_error():
raise BrokenPageError('Unable to go on the accounts list page')
self.select_form(nr=0)
self.set_all_readonly(False)
self['dialogActionPerformed'] = 'EQUIPEMENT_COMPLET'
self.submit()
if self.page.is_short_list():
self.select_form(nr=0)
self.set_all_readonly(False)
self['dialogActionPerformed'] = 'EQUIPEMENT_COMPLET'
self.submit()
self.token = self.page.get_token()

View file

@ -210,6 +210,9 @@ class AccountsPage(BasePage):
return False
def is_short_list(self):
return len(self.document.xpath('//script[contains(text(), "EQUIPEMENT_COMPLET")]')) > 0
def get_list(self):
account_type = Account.TYPE_UNKNOWN