Commit 7288a380 authored by Vincent Ardisson's avatar Vincent Ardisson Committed by Romain Bignon

[bforbank] fix case with multiple bourse accounts

Another page of the site doesn't clear cookies and avoids a redirection.
parent 83362a30
......@@ -25,7 +25,7 @@ from import Account, AccountNotFound
from .pages import (
LoginPage, ErrorPage, AccountsPage, HistoryPage, LoanHistoryPage, RibPage,
LifeInsuranceList, LifeInsuranceIframe, LifeInsuranceRedir,
TitrePage, BoursePage,
from .spirica_browser import SpiricaBrowser
......@@ -45,7 +45,7 @@ class BforbankBrowser(LoginBrowser):
lifeinsurance_iframe = URL(r'/client/accounts/lifeInsurance/consultationDetailSpirica.action', LifeInsuranceIframe)
lifeinsurance_redir = URL(r'', LifeInsuranceRedir)
titre = URL(r'/client/accounts/stocks/consultation/noFramePartenaireCATitres.action\?id=0', TitrePage)
bourse_login = URL(r'/espace-client/synthese/debranchementCaTitre/(?P<id>\d+)')
bourse = URL('',
......@@ -122,9 +122,7 @@ class BforbankBrowser(LoginBrowser):
self.spirica.logged = True
def get_bourse_account(self, account):
assert self.titre.is_here()
self.location( # "login" to bourse page
self.bourse_login.go( # "login" to bourse page
assert self.bourse.is_here()
......@@ -134,6 +132,8 @@ class BforbankBrowser(LoginBrowser):
self.logger.debug('iterating account %r', bourse_account)
return bourse_account
raise AccountNotFound()
def iter_investment(self, account):
......@@ -219,11 +219,6 @@ class LifeInsuranceRedir(LoggedPage, HTMLPage):
class TitrePage(LoggedPage, HTMLPage):
def get_redir(self):
return Regexp(CleanText('//body/@onload'), r"document.location='(.*)'", r'\1')(self.doc)
class BoursePage(AbstractPage):
PARENT = 'lcl'
PARENT_URL = 'bourse'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment