Commit 56689bde authored by Florian Duguet's avatar Florian Duguet Committed by Vincent A

[caisseepargne] return empty list if user is not allowed to have subscription

parent 03f98a17
......@@ -973,7 +973,10 @@ class CaisseEpargne(LoginBrowser, StatesMixin):
# some users don't have checking account
self.home_tache.go(tache='EPASYNT0')
self.page.go_subscription()
assert self.subscription.is_here()
if not self.subscription.is_here():
# if user is not allowed to have subscription we are redirected to IndexPage
assert self.home.is_here() and self.page.is_subscription_unauthorized()
return []
if self.page.has_subscriptions():
return self.page.iter_subscription()
......
......@@ -825,6 +825,9 @@ class IndexPage(LoggedPage, HTMLPage):
form['__EVENTARGUMENT'] = re.search(r'Ajax", "(.*)", true', link).group(1)
form.submit()
def is_subscription_unauthorized(self):
return 'non autorisée' in CleanText('//div[@id="MM_ContentMain"]')(self.doc)
def go_pro_transfer_availability(self):
form = self.get_form(id='main')
form['__EVENTTARGET'] = 'Menu_AJAX'
......
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