Skip to content

Commit

Permalink
test: Make element detail page work for partial stats
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Jan 29, 2025
1 parent 2fa5b24 commit c611244
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions iati_dashboard/templates/element.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ <h3 class="dashboard-panel-heading__title">Publishing this {{ element_or_attribu
</thead>
<tbody>
{% for publisher in func.sorted(publishers) %}
{% if publisher in current_stats.inverted_publisher.activities %}
<tr>
<td><a href="{{ url('dash-headlines-publisher-detail', args=[publisher]) }}">{{ publisher }}</a></td>
{% with publisher_inverted=func.get_publisher_stats(publisher, 'inverted-file') %}
Expand All @@ -45,6 +46,7 @@ <h3 class="dashboard-panel-heading__title">Publishing this {{ element_or_attribu
{% endwith %}
<td>{{ current_stats.inverted_publisher.activities[publisher] }}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions iati_dashboard/ui/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_exploringdata(self):
self.assertEqual(self.client.get(reverse("dash-exploringdata-elements")).status_code, 200)
self.assertEqual(
self.client.get(
reverse("dash-exploringdata-elements-detail", args=("iati-activity_activity-date_narrative",))
reverse("dash-exploringdata-elements-detail", args=("iati-activity_activity-date_@iso-date",))
).status_code,
200,
)
Expand Down Expand Up @@ -253,7 +253,7 @@ def test_slug_page_redirects(self):
self.client.get(r"/codelist/2/[email protected]"), reverse("dash-exploringdata-codelists"), status_code=301
)
self.assertRedirects(
self.client.get(r"/element/iati-activity_activity-date_narrative.html"),
self.client.get(r"/element/iati-activity_activity-date_@iso-date.html"),
reverse("dash-exploringdata-elements"),
status_code=301,
)
Expand Down

0 comments on commit c611244

Please sign in to comment.