From daa3a1da272069509bba5f5a1d1124d5d6351a87 Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Tue, 18 Jun 2019 14:49:14 +0200 Subject: [PATCH] lingo: mark when pesv2 payment protocol is active in tipi form (#34119) --- combo/apps/lingo/models.py | 1 + tests/test_lingo_cells.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/combo/apps/lingo/models.py b/combo/apps/lingo/models.py index b491d4a7..aeca946f 100644 --- a/combo/apps/lingo/models.py +++ b/combo/apps/lingo/models.py @@ -766,6 +766,7 @@ class TipiPaymentFormCell(CellBase): context['mode'] = 'T' if self.test_mode else 'M' context['control_protocol'] = self.control_protocol context['regies'] = [] + context['pesv2'] = self.control_protocol == 'pesv2' for field in reference_fields: if getattr(self, field['name']): field['default'] = getattr(self, field['name']) diff --git a/tests/test_lingo_cells.py b/tests/test_lingo_cells.py index c8250514..3b5135b5 100644 --- a/tests/test_lingo_cells.py +++ b/tests/test_lingo_cells.py @@ -195,6 +195,7 @@ def test_tipi_cell(): assert 'id="roldeb"' not in html assert 'id="roldet"' not in html assert 'data-saisie="M"' in html + assert 'data-pesv2="True"' in html cell.control_protocol = 'rolmre' cell.test_mode = True @@ -206,6 +207,7 @@ def test_tipi_cell(): assert 'id="idpce"' not in html assert 'id="idligne"' not in html assert 'data-saisie="T"' in html + assert 'data-pesv2="False"' in html cell_media = str(cell.media) assert "js/tipi.js" in cell_media