From 4806ab13242c48aa08a1493c6e59ae1d62adb602 Mon Sep 17 00:00:00 2001 From: Vincent Ardisson Date: Fri, 30 Mar 2018 17:30:48 +0200 Subject: [PATCH] [creditmutuel] don't re-decode the page text The real fix would be to identify in which xpath the text can show up instead of grepping in the whole text and be forced to support html entities like "é" Closes: 598848@redmine --- modules/creditmutuel/pages.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py index ece026d8bc..da0db20773 100644 --- a/modules/creditmutuel/pages.py +++ b/modules/creditmutuel/pages.py @@ -1069,9 +1069,6 @@ def get_from_account_index(self, account): def get_to_account_index(self, account): return self.get_account_index(self.RECIPIENT_STRING, account) - def get_unicode_content(self): - return self.content.decode(self.detect_encoding()) - def prepare_transfer(self, account, to, amount, reason): form = self.get_form(id='P:F', submit='//input[@type="submit" and contains(@value, "Valider")]') form['data_input_indiceCompteADebiter'] = self.get_from_account_index(account.id) @@ -1085,7 +1082,7 @@ def prepare_transfer(self, account, to, amount, reason): def check_errors(self): # look for known errors - content = self.get_unicode_content() + content = self.text messages = ['Le montant du virement doit être positif, veuillez le modifier', 'Montant maximum autorisé au débit pour ce compte', 'Dépassement du montant journalier autorisé', @@ -1142,7 +1139,7 @@ def handle_response(self, account, recipient, amount, reason): def create_transfer(self, transfer): self.check_errors() # look for the known "everything went well" message - content = self.get_unicode_content() + content = self.text transfer_ok_message = ['Votre virement a été exécuté', 'Ce virement a été enregistré ce jour', 'Ce virement a été enregistré ce jour'] -- GitLab