Skip to content

Commit c03db08

Browse files
[PRMP-1283] add test
1 parent a45adbf commit c03db08

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lambdas/tests/unit/services/test_authoriser_service.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pytest
22
from enums.repository_role import RepositoryRole
3+
from models.staging_metadata import NHS_NUMBER_PLACEHOLDER
34
from services.authoriser_service import AuthoriserService
45
from tests.unit.conftest import TEST_UUID
56
from utils.exceptions import AuthorisationException
@@ -145,6 +146,15 @@ def test_deny_access_policy_for_various_paths_and_roles(
145146
assert actual == expected
146147

147148

149+
def test_deny_access_policy_allows_review_for_placeholder_nhs_number(
150+
mock_auth_service: AuthoriserService,
151+
152+
):
153+
roles = [RepositoryRole.GP_ADMIN.value, RepositoryRole.GP_CLINICAL.value, RepositoryRole.PCSE.value]
154+
for role in roles:
155+
actual = mock_auth_service.deny_access_policy(f"/DocumentReview/{TEST_UUID}/1", role, NHS_NUMBER_PLACEHOLDER)
156+
assert actual == False
157+
148158
@pytest.mark.parametrize(
149159
"path",
150160
[

0 commit comments

Comments
 (0)