handle investment pages even if they aren't implemented yet

This commit is contained in:
Romain Bignon 2014-10-16 11:11:09 +02:00
commit 251eaef0c7
2 changed files with 12 additions and 7 deletions

View file

@ -25,7 +25,7 @@ from dateutil.relativedelta import relativedelta
from weboob.deprecated.browser import Browser, BrowserIncorrectPassword
from .pages.login import LoginPage
from .pages.accounts_list import GlobalAccountsList, AccountsList, AccountHistoryPage
from .pages.accounts_list import GlobalAccountsList, AccountsList, AccountHistoryPage, InvestmentHistoryPage
__all__ = ['Fortuneo']
@ -45,7 +45,8 @@ class Fortuneo(Browser):
'.*/prive/mes-comptes/livret/consulter-situation/consulter-solde\.jsp.*' : AccountHistoryPage,
'.*/prive/mes-comptes/compte-courant/consulter-situation/consulter-solde\.jsp.*' : AccountHistoryPage,
'.*/prive/mes-comptes/compte-titres-.*': InvestmentHistoryPage,
'.*/prive/mes-comptes/assurance-vie.*': InvestmentHistoryPage,
}
def __init__(self, *args, **kwargs):
@ -85,11 +86,12 @@ class Fortuneo(Browser):
def get_history(self, account):
self.location(account._link_id)
self.select_form(name='ConsultationHistoriqueOperationsForm')
self.set_all_readonly(False)
self['dateRechercheDebut'] = (date.today() - relativedelta(years=1)).strftime('%d/%m/%Y')
self['nbrEltsParPage'] = '100'
self.submit()
if self.is_on_page(AccountHistoryPage):
self.select_form(name='ConsultationHistoriqueOperationsForm')
self.set_all_readonly(False)
self['dateRechercheDebut'] = (date.today() - relativedelta(years=1)).strftime('%d/%m/%Y')
self['nbrEltsParPage'] = '100'
self.submit()
return self.page.get_operations(account)

View file

@ -49,6 +49,9 @@ class Transaction(FrenchTransaction):
(re.compile('^(?P<category>REMISE CHEQUES)(?P<text>.*)'), FrenchTransaction.TYPE_DEPOSIT),
]
class InvestmentHistoryPage(Page):
def get_operations(self, _id):
raise NotImplementedError()
class AccountHistoryPage(Page):
def get_operations(self, _id):