CrAgr: fixed regression induced by commit cb906211

This commit is contained in:
Xavier G 2011-08-22 21:51:37 +02:00 committed by Romain Bignon
commit 7f3c4be18b

View file

@ -72,10 +72,11 @@ class Cragr(BaseBrowser):
raise BrowserIncorrectPassword()
def get_accounts_list(self):
self.home()
# if there is no redirection but we are connected, go to a page that will be recognized
# as the account list page
# this is a hack, a better solution would be to recognize the page regardless of the URL
# FIXME we call the login() method that will redirect to the accounts list page.
# However, if we are already logged, using the "Comptes" link would be a better approach.
# Something like //img[contains(@alt, "Comptes")] may be generic enough.
# Note the same hack is used in the do_transfer method.
self.login()
return self.page.get_list()
def home(self):
@ -120,7 +121,7 @@ class Cragr(BaseBrowser):
"""
# access the transfer page
transfer_page_unreachable_message = u'Could not reach the transfer page.'
self.home()
self.login()
if not self.page.is_accounts_list():
raise TransferError(transfer_page_unreachable_message)