The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

Commit 3c167328 authored by ROLY Dorian's avatar ROLY Dorian Committed by Vincent A

[edfprofessionnel] Fix premium spaces detection

I've made a specific page for premium spaces, inherited from classic spaces, and fix the priority of the URLs browser side by interverting
premium_client_space and client_space

closes: 21138@sibi, 21143@sibi
parent f8ce3220
......@@ -11,20 +11,20 @@
from .collectivites_pages import (
ClientSpace, CnicePage, AuraPage, PdfPage, AuthenticationErrorPage,
ValidatePage, AiguillagePage, RedirectPage,
ValidatePage, AiguillagePage, RedirectPage, ClientPremiumSpace,
)
class EdfproCollectivitesBrowser(LoginBrowser):
BASEURL = 'https://entreprises-collectivites.edf.fr'
premium_client_space = URL(r'/espaceclientpremium/s/aiguillage', ClientPremiumSpace)
client_space = URL(
r'/espaceclient/s/$',
r'/espaceclient(?:premium)?/s/aiguillage',
r'/espaceclient/s/aiguillage',
r'/espaces/s/$',
ClientSpace,
)
premium_client_space = URL(r'/espaceclientpremium/s/aiguillage', ClientSpace)
authentication_error = URL(r'/espaceclient/_nc_external', AuthenticationErrorPage)
cnice = URL(r'/espace(s|client)/services/authcallback/CNICE', CnicePage)
aura = URL(r'/espaceclient/s/sfsites/aura', AuraPage)
......
......@@ -65,6 +65,10 @@ def get_token(self):
return aura_config['token']
class ClientPremiumSpace(ClientSpace):
pass
class CnicePage(HTMLPage):
def get_frontdoor_url(self):
return Regexp(Attr('//head/meta[@http-equiv="Refresh"]', 'content'), r'URL=(.*)')(self.doc)
......
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