mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
Split generating authorization headers by type
In response to [1]. [1]: https://github.com/alphagov/notifications-api/pull/3300#discussion_r681653248
This commit is contained in:
@@ -50,7 +50,7 @@ from app.models import (
|
||||
Template,
|
||||
TemplateHistory,
|
||||
)
|
||||
from tests import create_authorization_header
|
||||
from tests import create_admin_authorization_header
|
||||
from tests.app.db import (
|
||||
create_api_key,
|
||||
create_inbound_number,
|
||||
@@ -936,7 +936,7 @@ def admin_request(client):
|
||||
def get(endpoint, _expected_status=200, **endpoint_kwargs):
|
||||
resp = client.get(
|
||||
url_for(endpoint, **(endpoint_kwargs or {})),
|
||||
headers=[create_authorization_header()]
|
||||
headers=[create_admin_authorization_header()]
|
||||
)
|
||||
json_resp = resp.json
|
||||
assert resp.status_code == _expected_status
|
||||
@@ -947,7 +947,7 @@ def admin_request(client):
|
||||
resp = client.post(
|
||||
url_for(endpoint, **(endpoint_kwargs or {})),
|
||||
data=json.dumps(_data),
|
||||
headers=[('Content-Type', 'application/json'), create_authorization_header()]
|
||||
headers=[('Content-Type', 'application/json'), create_admin_authorization_header()]
|
||||
)
|
||||
if resp.get_data():
|
||||
json_resp = resp.json
|
||||
@@ -960,7 +960,7 @@ def admin_request(client):
|
||||
def delete(endpoint, _expected_status=204, **endpoint_kwargs):
|
||||
resp = client.delete(
|
||||
url_for(endpoint, **(endpoint_kwargs or {})),
|
||||
headers=[create_authorization_header()]
|
||||
headers=[create_admin_authorization_header()]
|
||||
)
|
||||
if resp.get_data():
|
||||
json_resp = resp.json
|
||||
|
||||
Reference in New Issue
Block a user