support case where user may accept TERMS_OF_USE
This commit is contained in:
parent
9a9f061beb
commit
75a704de04
1 changed files with 10 additions and 0 deletions
|
|
@ -243,6 +243,16 @@ class Login2Page(LoginPage):
|
|||
|
||||
doc = json.load(r)
|
||||
self.logger.debug(doc)
|
||||
if 'phase' in doc and doc['phares']['state'] == 'TERMS_OF_USE':
|
||||
# Got:
|
||||
# {u'phase': {u'state': u'TERMS_OF_USE'}, u'validationUnits': [{u'LIST_OF_TERMS': [{u'type': u'TERMS', u'id': u'b7f28f91-7aa0-48aa-8028-deec13ae341b', u'reference': u'CGU_CYBERPLUS'}]}]}
|
||||
payload = {'validate': doc['validationUnits'][0]}
|
||||
req = self.browser.request_class(self.request_url + '/step')
|
||||
req.add_header('Content-Type', 'application/json')
|
||||
r = self.browser.openurl(req, json.dumps(payload))
|
||||
doc = json.load(r)
|
||||
self.logger.debug(doc)
|
||||
|
||||
if ('phase' in doc and doc['phase']['previousResult'] == 'FAILED_AUTHENTICATION') or \
|
||||
doc['response']['status'] != 'AUTHENTICATION_SUCCESS':
|
||||
raise BrowserIncorrectPassword()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue