unit tests + lint

This commit is contained in:
zandercymatics 2025-03-25 08:03:06 -06:00
parent 5d2e250467
commit 150cd6e747
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 6 additions and 4 deletions

View file

@ -43,6 +43,8 @@ class TestGroups(TestCase):
"add_portfolio",
"change_portfolio",
"delete_portfolio",
"add_portfolioinvitation",
"view_portfolioinvitation",
"add_seniorofficial",
"change_seniorofficial",
"delete_seniorofficial",

View file

@ -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")

View file

@ -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()