Projet

Général

Profil

0001-lingo-mark-when-pesv2-payment-protocol-is-active-in-.patch

Voir les différences:

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(+)
combo/apps/lingo/models.py
766 766
        context['mode'] = 'T' if self.test_mode else 'M'
767 767
        context['control_protocol'] = self.control_protocol
768 768
        context['regies'] = []
769
        context['pesv2'] = self.control_protocol == 'pesv2'
769 770
        for field in reference_fields:
770 771
            if getattr(self, field['name']):
771 772
                field['default'] = getattr(self, field['name'])
tests/test_lingo_cells.py
195 195
    assert 'id="roldeb"' not in html
196 196
    assert 'id="roldet"' not in html
197 197
    assert 'data-saisie="M"' in html
198
    assert 'data-pesv2="True"' in html
198 199

  
199 200
    cell.control_protocol = 'rolmre'
200 201
    cell.test_mode = True
......
206 207
    assert 'id="idpce"' not in html
207 208
    assert 'id="idligne"' not in html
208 209
    assert 'data-saisie="T"' in html
210
    assert 'data-pesv2="False"' in html
209 211

  
210 212
    cell_media = str(cell.media)
211 213
    assert "js/tipi.js" in cell_media
212
-