Commit 175c1fca authored by Jerome Berthier's avatar Jerome Berthier Committed by Romain Bignon

[creditdunord] Handle a new BrowserPasswordExpired message

There is no message within the redirection page, so we need to reach the EntryPage to check whether this message exists.
parent cb70565d
......@@ -83,9 +83,18 @@ class CreditDuNordBrowser(LoginBrowser):
if not self.logged:
raise BrowserIncorrectPassword()
# The redirection page may contain a message
if self.page.doc.xpath('//head[title="Authentification"]/script[contains(text(), "_pageLabel=reinitialisation_mot_de_passe")]'):
raise BrowserPasswordExpired()
if not self.entrypage.is_here():
self.entrypage.go()
# The main page may contain a message as well
msg = 'vous devez modifier votre code confidentiel à la première connexion puis tous les 12 mois'
if self.page.doc.xpath('//b[contains(text(), "%s")]' % msg):
raise BrowserPasswordExpired(msg.capitalize())
def _iter_accounts(self):
self.loans.go(account_type=self.account_type, loans_page_label=self.loans_page_label)
for a in self.page.get_list():
......
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