mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 08:16:51 -04:00
Replace sevice api client get template calls with Service methods
Instead of using the API client directly views are now calling one of two Service model methods: `get_template` is used for view actions, where the user should see the template page even if they don't have access to the template folder (since all templates are still inked from the dashboard or the sent notifications pages). `get_template_with_user_permission_or_403` will check if the user has access to the template's folder first and return 403 otherwise. This method is used for any endpoints that result in an action: editing template attributes, deleting templates or sending messages.
This commit is contained in:
@@ -835,7 +835,7 @@ def mock_get_template_versions(mocker, fake_uuid, user=None):
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_get_service_template_with_placeholders(mocker):
|
||||
def _get(service_id, template_id):
|
||||
def _get(service_id, template_id, version=None):
|
||||
template = template_json(
|
||||
service_id, template_id, "Two week reminder", "sms", "((name)), Template <em>content</em> with & entity"
|
||||
)
|
||||
@@ -849,7 +849,7 @@ def mock_get_service_template_with_placeholders(mocker):
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_get_service_template_with_placeholders_same_as_recipient(mocker):
|
||||
def _get(service_id, template_id):
|
||||
def _get(service_id, template_id, version=None):
|
||||
template = template_json(
|
||||
service_id, template_id, "Two week reminder", "sms", "((name)) ((date)) ((PHONENUMBER))"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user