summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerghei Mihai <smihai@entrouvert.com>2019-06-18 12:49:14 (GMT)
committerSerghei Mihai <smihai@entrouvert.com>2019-06-20 10:16:52 (GMT)
commitdaa3a1da272069509bba5f5a1d1124d5d6351a87 (patch)
tree36532ecc08b8925f1cb3b3a96e6e3545acfe3c51
parent33b4197ea5c017beefc011f71090bbd9d9c7de25 (diff)
downloadcombo-master.zip
combo-master.tar.gz
combo-master.tar.bz2
lingo: mark when pesv2 payment protocol is active in tipi form (#34119)HEADv2.20master
-rw-r--r--combo/apps/lingo/models.py1
-rw-r--r--tests/test_lingo_cells.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/combo/apps/lingo/models.py b/combo/apps/lingo/models.py
index b491d4a..aeca946 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 c825051..3b5135b 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