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