Commit 678c0db1 authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Vincent A

[apivie] Remove code related to InfoPage

This Action Needed is easily bypassed since now we are fecthing the
accounts on the API. We still keep the Page class to handle the related URL
after login.
parent d56303d2
......@@ -25,7 +25,7 @@ from urllib3.exceptions import ReadTimeoutError
from weboob.tools.decorators import retry
from weboob.browser import LoginBrowser, URL, need_login
from weboob.exceptions import BrowserIncorrectPassword, ActionNeeded, BrowserUnavailable
from weboob.exceptions import BrowserIncorrectPassword, BrowserUnavailable
from weboob.browser.exceptions import ClientError
from .pages import (
......@@ -44,7 +44,7 @@ class ApivieBrowser(LoginBrowser):
LoginPage
)
wrongpass = URL(r'/accueil.*saveLastPath=false', WrongpassPage)
info = URL(r'/coordonnees', r'/accueil-connect', InfoPage)
info = URL(r'/(coordonnees|accueil-connect)', InfoPage)
home = URL(r'/contrats-cosy3', HomePage)
accounts = URL(r'https://(?P<api_url>.*)/interne/contrat/', AccountsPage)
investments = URL(r'https://(?P<api_url>.*)/contrat/(?P<account_id>\d+)$', InvestmentPage)
......@@ -62,13 +62,6 @@ class ApivieBrowser(LoginBrowser):
self.page.login(self.username, self.password)
# If the user's contact info is too old the website asks to verify them.
# We are logged but we cannot go further.
if self.info.is_here():
error_message = self.page.get_error_message()
assert error_message, 'Error message location has changed on info page'
raise ActionNeeded(error_message)
if self.wrongpass.is_here():
raise BrowserIncorrectPassword()
......
......@@ -49,8 +49,7 @@ class WrongpassPage(HTMLPage):
class InfoPage(LoggedPage, HTMLPage):
def get_error_message(self):
return CleanText('//span[@class="ui-messages-fatal-detail"]')(self.doc)
pass
class HomePage(LoggedPage, HTMLPage):
......
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