diff --git a/combo/apps/wcs/templates/combo/wcs/current_drafts.html b/combo/apps/wcs/templates/combo/wcs/current_drafts.html index 1a1e1b09..9a688e8f 100644 --- a/combo/apps/wcs/templates/combo/wcs/current_drafts.html +++ b/combo/apps/wcs/templates/combo/wcs/current_drafts.html @@ -17,5 +17,6 @@ {% endif %} {% endfor %} +{% if not drafts %}

{% trans "There are no current drafts." %}

{% endif %} {% include "combo/pagination.html" %} {% endblock %} diff --git a/combo/apps/wcs/templates/combo/wcs/current_forms.html b/combo/apps/wcs/templates/combo/wcs/current_forms.html index 38ce44a1..90623008 100644 --- a/combo/apps/wcs/templates/combo/wcs/current_forms.html +++ b/combo/apps/wcs/templates/combo/wcs/current_forms.html @@ -6,5 +6,6 @@ {% include "combo/wcs/list_of_forms.html" with forms=forms %} {% endfor %} +{% if not forms %}

{% trans "There are no current forms." %}

{% endif %} {% include "combo/pagination.html" %} {% endblock %} diff --git a/combo/apps/wcs/templates/combo/wcs/user_all_forms.html b/combo/apps/wcs/templates/combo/wcs/user_all_forms.html index 82d4fc89..078b2902 100644 --- a/combo/apps/wcs/templates/combo/wcs/user_all_forms.html +++ b/combo/apps/wcs/templates/combo/wcs/user_all_forms.html @@ -6,5 +6,6 @@ {% include "combo/wcs/list_of_forms.html" with forms=forms %} {% endfor %} +{% if not forms %}

{% trans "There are no forms." %}

{% endif %} {% include "combo/pagination.html" %} {% endblock %} diff --git a/combo/apps/wcs/templates/combo/wcs/user_done_forms.html b/combo/apps/wcs/templates/combo/wcs/user_done_forms.html index 754fc43c..d88ae148 100644 --- a/combo/apps/wcs/templates/combo/wcs/user_done_forms.html +++ b/combo/apps/wcs/templates/combo/wcs/user_done_forms.html @@ -6,5 +6,6 @@ {% include "combo/wcs/list_of_forms.html" with forms=forms %} {% endfor %} +{% if not forms %}

{% trans "There are no done forms or they have been removed." %}

{% endif %} {% include "combo/pagination.html" %} {% endblock %} diff --git a/tests/test_wcs.py b/tests/test_wcs.py index e28171a5..13aea631 100644 --- a/tests/test_wcs.py +++ b/tests/test_wcs.py @@ -495,6 +495,20 @@ def test_current_forms_cell_render(context): cell.get_cell_extra_context(context) assert requests_get.call_args_list[0][0][0] == '/api/user/forms?limit=100&sort=desc&include-drafts=on' + # check empty messages + cell.categories = {'data': ['default:test-3']} + cell.current_forms = True + cell.done_forms = False + cell.include_drafts = False + result = cell.render(context) + assert 'There are no current forms.' in result + cell.done_forms = True + result = cell.render(context) + assert 'There are no forms.' in result + cell.current_forms = False + result = cell.render(context) + assert 'There are no done forms' in result + @wcs_present def test_current_forms_cell_validity(context): @@ -844,6 +858,7 @@ def test_current_drafts_cell_render_unlogged(context): result = cell.render(context) assert not 'http://127.0.0.1:8999/third-form-title' in result # no form + @wcs_present def test_current_drafts_cell_render_logged_in(context): page = Page(title='xxx', slug='test_current_drafts_cell_render', template_name='standard') @@ -874,6 +889,10 @@ def test_current_drafts_cell_render_logged_in(context): extra_context = cell.get_cell_extra_context(context) assert len(extra_context['drafts']) == 0 + # check empty message + result = cell.render(context) + assert 'There are no current drafts.' in result + @wcs_present def test_current_drafts_cell_check_validity(context):