diff --git a/app/general/tests/test_documents.py b/app/general/tests/test_documents.py index dd2d2fe0..6d6f1d46 100644 --- a/app/general/tests/test_documents.py +++ b/app/general/tests/test_documents.py @@ -40,3 +40,9 @@ def test_view_basics(self): self.assertEqual(response.status_code, 200) self.assertContains(response, 'id="main-heading"') self.assertIn("documents", response.context) + + def test_with_filters(self): + response = self.client.get(reverse("documents"), {"language": self.language3.id}) + self.assertEqual(response.status_code, 200) + self.assertEqual(len(response.context["documents"]), 1) + self.assertEqual(response.context["documents"][0]["document"].title, "Document 6") diff --git a/app/templates/app/_subj_lang_institution_filter.html b/app/templates/app/_subj_lang_institution_filter.html index de3e81ce..158ea7e6 100644 --- a/app/templates/app/_subj_lang_institution_filter.html +++ b/app/templates/app/_subj_lang_institution_filter.html @@ -1,6 +1,6 @@ {% load i18n %} {% spaceless %} -
+
@@ -41,7 +41,7 @@
- {% trans "Reset" %} + {% trans "Reset" %}
{% endspaceless %} diff --git a/app/templates/app/documents.html b/app/templates/app/documents.html index 67e56dbc..ecb18399 100644 --- a/app/templates/app/documents.html +++ b/app/templates/app/documents.html @@ -10,7 +10,7 @@

{% trans "Documents" %}

- {% include "app/_subj_lang_institution_filter.html" %} + {% include "app/_subj_lang_institution_filter.html" with view="documents"%} {% for item in documents %}
{# additional indent simplifies comparison with projects.html #} diff --git a/app/templates/app/projects.html b/app/templates/app/projects.html index 7b90439a..64a21c6a 100644 --- a/app/templates/app/projects.html +++ b/app/templates/app/projects.html @@ -10,7 +10,7 @@

{% trans "Projects" %}

- {% include "app/_subj_lang_institution_filter.html" %} + {% include "app/_subj_lang_institution_filter.html" with view="projects" %} {% for item in projects %}
{# container adds unwanted padding #}