mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 09:19:48 -04:00
Stop using platform_admin_client fixture
We have a `client_request` fixture which does a bunch of useful stuff like: - checking the status code of the response - returning a `BeautifulSoup` object For most tests of a platform admin view we used `platform_admin_client` instead. This is not as good because it returns a raw `Response` object and doesn’t do the additional checks. This commit converts all the tests using `platform_admin_client` to: use new `client_request` and log in as `platform_admin_user` before making any requests. This is also nice because it makes any test easy to parametrize with additional users, for example to test differences in behaviour dependant on being platform admin or not.
This commit is contained in:
@@ -331,7 +331,6 @@ def platform_admin_list_complaints():
|
||||
return render_template(
|
||||
'views/platform-admin/complaints.html',
|
||||
complaints=response['complaints'],
|
||||
page_title='All Complaints',
|
||||
page=page,
|
||||
prev_page=prev_page,
|
||||
next_page=next_page,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
|
||||
{% block per_page_title %}
|
||||
User information for {{ user.name }}
|
||||
{{ user.name }}
|
||||
{% endblock %}
|
||||
|
||||
{% block platform_admin_content %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "views/platform-admin/_base_template.html" %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Inbound Numbers
|
||||
{% block per_page_title %}
|
||||
Inbound SMS
|
||||
{% endblock %}
|
||||
|
||||
{% set table_headings = {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
{% from "components/back-link/macro.njk" import govukBackLink %}
|
||||
|
||||
{% block per_page_title %}
|
||||
{{ '{} letter branding'.format('Update' if is_update else 'Create')}}
|
||||
{{ '{} letter branding'.format('Update' if is_update else 'Add')}}
|
||||
{% endblock %}
|
||||
|
||||
{% block backLink %}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{% from "components/table.html" import list_table, field, text_field, link_field, right_aligned_field_heading, hidden_field_heading %}
|
||||
|
||||
{% block per_page_title %}
|
||||
{{ page_title|capitalize }}
|
||||
Email complaints
|
||||
{% endblock %}
|
||||
|
||||
{% block platform_admin_content %}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
{% from "components/button/macro.njk" import govukButton %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Platform admin
|
||||
Summary
|
||||
{% endblock %}
|
||||
|
||||
{% block platform_admin_content %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "views/platform-admin/_base_template.html" %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Platform admin
|
||||
Reports
|
||||
{% endblock %}
|
||||
|
||||
{% block platform_admin_content %}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{% from "components/back-link/macro.njk" import govukBackLink %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Data retention
|
||||
Set data retention
|
||||
{% endblock %}
|
||||
|
||||
{% block backLink %}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{% from "components/back-link/macro.njk" import govukBackLink %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Data retention
|
||||
Set data retention
|
||||
{% endblock %}
|
||||
|
||||
{% block backLink %}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{% from "components/back-link/macro.njk" import govukBackLink %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Emails
|
||||
Free text message allowance
|
||||
{% endblock %}
|
||||
|
||||
{% block backLink %}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{% from "components/back-link/macro.njk" import govukBackLink %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Set daily message limit
|
||||
Daily message limit
|
||||
{% endblock %}
|
||||
|
||||
{% block backLink %}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{% from "components/back-link/macro.njk" import govukBackLink %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Set rate limit
|
||||
Rate limit
|
||||
{% endblock %}
|
||||
|
||||
{% block backLink %}
|
||||
|
||||
Reference in New Issue
Block a user