From 2d73911081cf7f47345b1ea8625157a8e758baba Mon Sep 17 00:00:00 2001 From: George Drummond Date: Wed, 20 Mar 2019 13:06:22 -0400 Subject: [PATCH] Declare specific permissions in test --- templates/fragments/primary_point_of_contact.html | 2 +- tests/routes/portfolios/test_portfolios_index.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/fragments/primary_point_of_contact.html b/templates/fragments/primary_point_of_contact.html index eaba275a..692bdbd6 100644 --- a/templates/fragments/primary_point_of_contact.html +++ b/templates/fragments/primary_point_of_contact.html @@ -14,7 +14,7 @@ {{ portfolio.owner.phone_number | usPhone }}

- {% if portfolio.owner == current_user %} + {% if user_can(permissions.EDIT_PORTFOLIO_POC) %}
{{ "fragments.ppoc.update_btn" | translate }} diff --git a/tests/routes/portfolios/test_portfolios_index.py b/tests/routes/portfolios/test_portfolios_index.py index 1704ec85..7f631c52 100644 --- a/tests/routes/portfolios/test_portfolios_index.py +++ b/tests/routes/portfolios/test_portfolios_index.py @@ -66,7 +66,9 @@ def test_portfolio_admin_screen_when_ppoc(client, user_session): def test_portfolio_admin_screen_when_not_ppoc(client, user_session): portfolio = PortfolioFactory.create() user = UserFactory.create() - permission_sets = PermissionSets.get_all() + permission_sets = PermissionSets.get_many( + [PermissionSets.EDIT_PORTFOLIO_ADMIN, PermissionSets.VIEW_PORTFOLIO_ADMIN] + ) PortfolioRoleFactory.create( portfolio=portfolio, user=user, permission_sets=permission_sets )