From 3a52380908968592ad8737c2761520ca30ec918a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lande=20Adrien?= Date: Fri, 9 Aug 2019 14:49:58 +0200 Subject: [PATCH] [cic] multiple spaces in transfer label `strip` does not work to remove multiple spaces Closes: 38559@sibi --- modules/creditmutuel/pages.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py index d6eacfc818..0f15a4ca09 100644 --- a/modules/creditmutuel/pages.py +++ b/modules/creditmutuel/pages.py @@ -1483,8 +1483,12 @@ def check_data_consistency(self, account_id, recipient_id, amount, reason): replace_dots=True)(self.doc) assert r_amount == Decimal(amount) currency = FrenchTransaction.Currency('//table[@summary]/tbody/tr[th[contains(text(), "Montant")]]/td')(self.doc) + if reason is not None: - assert reason.upper()[:22].strip() in CleanText('//table[@summary]/tbody/tr[th[contains(text(), "Intitulé pour le compte à débiter")]]/td')(self.doc) + creditor_label = CleanText('.').filter(reason.upper()[:22]) + debitor_label = CleanText('//table[@summary]/tbody/tr[th[contains(text(), "Intitulé pour le compte à débiter")]]/td')(self.doc) + assert creditor_label in debitor_label, 'Difference in label between the debitor and the creditor' + return exec_date, r_amount, currency def handle_response(self, account, recipient, amount, reason, exec_date): -- GitLab