From 150cd6e747d3b9d5b99d24d009c16201f65aba81 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Tue, 25 Mar 2025 08:03:06 -0600 Subject: [PATCH] unit tests + lint --- src/registrar/tests/test_migrations.py | 2 ++ src/registrar/tests/test_views_domain.py | 5 +++-- src/registrar/views/domain.py | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/registrar/tests/test_migrations.py b/src/registrar/tests/test_migrations.py index 11daca870..d6d643d8b 100644 --- a/src/registrar/tests/test_migrations.py +++ b/src/registrar/tests/test_migrations.py @@ -43,6 +43,8 @@ class TestGroups(TestCase): "add_portfolio", "change_portfolio", "delete_portfolio", + "add_portfolioinvitation", + "view_portfolioinvitation", "add_seniorofficial", "change_seniorofficial", "delete_seniorofficial", diff --git a/src/registrar/tests/test_views_domain.py b/src/registrar/tests/test_views_domain.py index 69c376fd4..d0f2f159c 100644 --- a/src/registrar/tests/test_views_domain.py +++ b/src/registrar/tests/test_views_domain.py @@ -441,10 +441,11 @@ class TestDomainDetail(TestDomainOverview): user.refresh_from_db() self.client.force_login(user) detail_page = self.client.get(f"/domain/{domain.id}") - # Check that alert message displays properly + # Check that alert message displays properly. + # This message is different for one user on the portfolio vs multiple. self.assertContains( detail_page, - "If you need to make updates, contact one of the listed domain managers.", + "If you need to become a domain manager, edit the domain assignments", ) # Check that user does not have option to Edit domain self.assertNotContains(detail_page, "Edit") diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 00cdada7a..5c808a737 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -406,8 +406,7 @@ class DomainView(DomainBaseView): context["hidden_security_emails"] = default_emails context["user_portfolio_permission"] = UserPortfolioPermission.objects.filter( - user=self.request.user, - portfolio=self.request.session.get("portfolio") + user=self.request.user, portfolio=self.request.session.get("portfolio") ).first() security_email = self.object.get_security_email()