bnporc fall back on old website for pro accounts

This commit is contained in:
Baptiste Delpey 2015-07-29 13:36:50 +02:00 committed by Romain Bignon
commit 94cb1c4e21
3 changed files with 18 additions and 3 deletions

View file

@ -74,6 +74,13 @@ class BNPParibasBrowser(CompatMixin, JsonBrowserMixin, LoginBrowser):
history = URL('rop-wspl/rest/releveOp', HistoryPage)
transfer_init = URL('virement-wspl/rest/initialisationVirement', TransferInitPage)
class ProAccount(Exception):
pass
def __init__(self, *args, **kwargs):
super(BNPParibasBrowser, self).__init__(*args, **kwargs)
self.do_login()
def switch(self, subdomain):
self.BASEURL = self.BASEURL_TEMPLATE % subdomain

View file

@ -109,7 +109,9 @@ class LoginPage(JsonPage):
# XXX useless ?
csrf = self.generate_token()
self.browser.location(target, data={'AUTH': auth, 'CSRF': csrf})
response = self.browser.location(target, data={'AUTH': auth, 'CSRF': csrf})
if response.url.startswith('https://pro.mabanque.bnpparibas'):
raise self.browser.ProAccount()
class BNPPage(LoggedPage, JsonPage):