lingo: mark when pesv2 payment protocol is active in tipi form (#34119)

This commit is contained in:
Serghei Mihai 2019-06-18 14:49:14 +02:00
parent 33b4197ea5
commit daa3a1da27
2 changed files with 3 additions and 0 deletions

View File

@ -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'])

View File

@ -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