Commit 2143afe6 authored by Maxime Gasselin's avatar Maxime Gasselin Committed by Romain Bignon

[caissedepargne] Check transfer functionality in pro space

If we continue the requests, we will send a sms to the customer. We have
to check precociously if the user doesn't have recipient/transfer
functionalities.

Closes: 28047@sibi
parent dcaefd0c
......@@ -672,6 +672,13 @@ class CaisseEpargne(LoginBrowser, StatesMixin):
if origin_account.type == Account.TYPE_LOAN:
return []
if 'pro' in self.url:
# If transfer is not yet allowed, the next step will send a sms to the customer to validate it
self.home.go()
self.page.go_pro_transfer_availability()
if not self.page.is_transfer_allowed():
return []
# Transfer unavailable
try:
self.pre_transfer(origin_account)
......
......@@ -739,6 +739,16 @@ class IndexPage(LoggedPage, HTMLPage):
form['__EVENTARGUMENT'] = re.search(r'Ajax", "(.*)", true', link).group(1)
form.submit()
def go_pro_transfer_availability(self):
form = self.get_form(id='main')
form['__EVENTTARGET'] = 'Menu_AJAX'
form['__EVENTARGUMENT'] = 'VIRLSRM0'
form['m_ScriptManager'] = 'm_ScriptManager|Menu_AJAX'
form.submit()
def is_transfer_allowed(self):
return not self.doc.xpath('//ul/li[contains(text(), "Aucun compte tiers n\'est disponible")]')
class ConsLoanPage(JsonPage):
def get_conso(self):
......
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