manager: display shared custody agenda start and end dates (#71941)

This commit is contained in:
Valentin Deniaud 2022-12-05 14:59:30 +01:00
parent c261233153
commit c48f849d39
2 changed files with 16 additions and 0 deletions

View File

@ -36,4 +36,16 @@
<p>{% trans "Configuration is not completed yet." %}</p>
</div>
{% endif %}
<div class="section">
{% if agenda.date_end %}
{% blocktrans trimmed with date_start=agenda.date_start date_end=agenda.date_end %}
This agenda applies from {{ date_start }} to {{ date_end }}.
{% endblocktrans %}
{% else %}
{% blocktrans trimmed with date_start=agenda.date_start %}
This agenda applies from {{ date_start }}.
{% endblocktrans %}
{% endif %}
</div>
{% endblock %}

View File

@ -236,6 +236,8 @@ def test_shared_custody_agenda_month_view_dates(app, admin_user):
days = [x.text for x in resp.pyquery('tbody tr th span')]
assert len(days) == 7 * 5
assert 'This agenda applies from Jan. 1, 2022.' in resp.text
# custody for half the month
agenda.date_start = datetime.date(2022, 2, 14)
agenda.save()
@ -255,6 +257,8 @@ def test_shared_custody_agenda_month_view_dates(app, admin_user):
assert resp.text.count('<td></td>') == 34
assert len([x.text for x in resp.pyquery('tbody tr td.guardian')]) == 1
assert 'This agenda applies from Feb. 14, 2022 to Feb. 14, 2022.' in resp.text
# month before date_start
resp = resp.click('')
assert resp.text.count('<td></td>') == 42