Skip to content

Commit

Permalink
fix test on service table
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingphilippe committed Dec 20, 2024
1 parent eceb2cb commit e18169f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions app/templates/views/platform-admin/services.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{% from "components/page-footer.html" import page_footer %}
{% from "components/big-number.html" import big_number, big_number_with_status %}
{% from "components/message-count-label.html" import message_count_label %}
{% from "components/table.html" import mapping_table, field, row_heading, row_group, row,
right_aligned_field_heading, hidden_field_heading, text_field %}
{% from "components/table.html" import mapping_table, field, row_heading, row_group, row, right_aligned_field_heading,
hidden_field_heading, text_field %}
{% from "components/form.html" import form_wrapper %}

{% macro stats_fields(channel, data) -%}
Expand Down Expand Up @@ -56,6 +56,8 @@
<span class="block text-small">{{ _("research mode") }}</span>
{% elif not service['restricted'] %}
<span class="text-small text-red-700 font-bold">{{ _("Live") }}</span>
{% else %}
<span></span>
{% endif %}
{% endcall %}

Expand Down
4 changes: 2 additions & 2 deletions tests/app/main/views/test_platform_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ def test_should_show_research_and_restricted_mode(
assert response.status_code == 200
mock_get_detailed_services.assert_called_once_with({"detailed": True, "include_from_test_key": True, "only_active": False})
page = BeautifulSoup(response.data.decode("utf-8"), "html.parser")
# get first column in second row, which contains flags as text.
# get first column in first row, which contains service name and flags as a span in a single th.
table_body = page.find_all("table")[0].find_all("tbody")[0]
service_mode = table_body.find_all("tbody")[0].find_all("tr")[1].find_all("td")[0].text.strip()
service_mode = table_body.find_all("tbody")[0].find_all("tr")[0].find_all("th")[0].find_all("span")[0].text.strip()
assert service_mode == displayed


Expand Down

0 comments on commit e18169f

Please sign in to comment.