From 9816452a4be98588b8d7276512ec754ea211103d Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Mon, 10 Sep 2018 22:50:52 +0200 Subject: [PATCH] tipi: do not show community identifier if only one defined (#15461) --- combo/apps/lingo/templates/lingo/tipi_form.html | 4 ++++ tests/test_lingo_cells.py | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/combo/apps/lingo/templates/lingo/tipi_form.html b/combo/apps/lingo/templates/lingo/tipi_form.html index d66e2b5f..98dfc575 100644 --- a/combo/apps/lingo/templates/lingo/tipi_form.html +++ b/combo/apps/lingo/templates/lingo/tipi_form.html @@ -8,6 +8,7 @@ + {% if regies|length > 1 %}

+ {% else %} + + {% endif %} diff --git a/tests/test_lingo_cells.py b/tests/test_lingo_cells.py index d1ba9a1a..9f525b22 100644 --- a/tests/test_lingo_cells.py +++ b/tests/test_lingo_cells.py @@ -170,7 +170,8 @@ def test_tipi_cell(): assert cell.template_name == 'lingo/tipi_form.html' html = cell.render({}) assert "

TIPI Payment

" in html - assert "Community identifier" in html + assert "Community identifier" not in html + assert '' in html assert 'id="exer"' in html assert 'id="idpce"' in html assert 'id="idligne"' in html @@ -192,3 +193,9 @@ def test_tipi_cell(): cell_media = str(cell.media) assert "js/tipi.js" in cell_media + + cell.regies = 'regie1, regie2' + cell.save() + html = cell.render({}) + assert "Community identifier" in html + assert '