Commit 3091a832 authored by Guillaume Risbourg's avatar Guillaume Risbourg Committed by Vincent A

[creditmutuel] Raise AuthMethodNotImplemented for sms validation in transfers

SMS validation can occur when a user just registered a new phone to use
the app validation one.
parent b270d104
......@@ -984,6 +984,8 @@ class CreditMutuelBrowser(TwoFactorBrowser):
self.key_form = self.page.get_personal_key_card_code_form()
raise TransferStep(transfer, Value('Clé', label=self.page.get_question()))
elif self.page.needs_otp_validation():
raise AuthMethodNotImplemented("La validation des transferts avec un code sms n'est pas encore disponible.")
msg = self.page.get_validation_msg()
if msg:
......
......@@ -2054,6 +2054,9 @@ class InternalTransferPage(LoggedPage, HTMLPage, AppValidationPage):
def needs_personal_key_card_validation(self):
return bool(CleanText('//div[contains(@class, "alerte")]/p[contains(text(), "Cette opération nécessite une sécurité supplémentaire")]')(self.doc))
def needs_otp_validation(self):
return bool(self.doc.xpath('//input[@name="otp_password"]'))
def can_transfer_pro(self, origin_account):
for li in self.doc.xpath('//ul[@id="idDetailsListCptDebiterVertical:ul"]//ul/li'):
if CleanText(li.xpath('.//span[@class="_c1 doux _c1"]'), replace=[(' ', '')])(self) in origin_account:
......
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