diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py index d6eacfc81835cba6788cb9cc9c28653c5e81ea25..0f15a4ca09dba531553fb45fef2b91cd553b0a3a 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):