From 34b2c2f35bbf733389f2c3ee69b158b18ebf02a7 Mon Sep 17 00:00:00 2001 From: Maxime Gasselin Date: Fri, 15 Feb 2019 11:28:18 +0100 Subject: [PATCH] [bp] Get Savings IBAN The link of the rib of savings accounts are only available on the history page. Closes: 31920@sibi --- modules/bp/pages/accountlist.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/bp/pages/accountlist.py b/modules/bp/pages/accountlist.py index 6b73bab373..2976861cd0 100644 --- a/modules/bp/pages/accountlist.py +++ b/modules/bp/pages/accountlist.py @@ -102,6 +102,14 @@ def obj_iban(self): if rib_link: response = self.page.browser.open(rib_link) return response.page.get_iban() + + elif Field('type')(self) == Account.TYPE_SAVINGS: + # The rib link is available on the history page (ex: Livret A) + his_page = self.page.browser.open(Field('url')(self)) + rib_link = Link('//a[abbr[contains(text(), "RIB")]]', default=NotAvailable)(his_page.page.doc) + if rib_link: + response = self.page.browser.open(rib_link) + return response.page.get_iban() return NotAvailable def obj_type(self): -- GitLab