From 5a342b2a396b5c75b3736c39fc3f8871cff18070 Mon Sep 17 00:00:00 2001 From: Pea Tyczynska Date: Tue, 16 Feb 2021 11:39:22 +0000 Subject: [PATCH] Test that only platform admins can update org notes --- .../main/views/organisations/test_organisations.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/app/main/views/organisations/test_organisations.py b/tests/app/main/views/organisations/test_organisations.py index 78a2562ce..c5442b51f 100644 --- a/tests/app/main/views/organisations/test_organisations.py +++ b/tests/app/main/views/organisations/test_organisations.py @@ -1318,6 +1318,20 @@ def test_update_organisation_notes( ) +def test_update_organisation_notes_errors_when_user_not_platform_admin( + client_request, + organisation_one, + mock_get_organisation, + mock_update_organisation, +): + client_request.post( + 'main.edit_organisation_notes', + org_id=organisation_one['id'], + _data={'notes': "Very fluffy"}, + _expected_status=403, + ) + + def test_update_organisation_notes_doesnt_call_api_when_notes_dont_change( platform_admin_client, organisation_one,