a few improvements to code, comments, and tests

This commit is contained in:
David Kennedy 2024-08-26 20:34:56 -04:00
parent 851e176f83
commit c2f71c984f
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
3 changed files with 17 additions and 9 deletions

View file

@ -268,7 +268,7 @@ class TestDomainRequestAdmin(MockEppLib):
@less_console_noise_decorator
def test_domain_requests_by_portfolio(self):
"""
Tests that domain_requests display for a portfolio.
Tests that domain_requests display for a portfolio. And requests not in portfolio do not display.
"""
portfolio, _ = Portfolio.objects.get_or_create(organization_name="Test Portfolio", creator=self.superuser)
@ -276,6 +276,9 @@ class TestDomainRequestAdmin(MockEppLib):
domain_request = completed_domain_request(
status=DomainRequest.DomainRequestStatus.IN_REVIEW, portfolio=portfolio
)
domain_request2 = completed_domain_request(
name="testdomain2.gov", status=DomainRequest.DomainRequestStatus.IN_REVIEW
)
self.client.force_login(self.superuser)
response = self.client.get(
@ -286,6 +289,7 @@ class TestDomainRequestAdmin(MockEppLib):
# Make sure the page loaded, and that we're on the right page
self.assertEqual(response.status_code, 200)
self.assertContains(response, domain_request.requested_domain.name)
self.assertNotContains(response, domain_request2.requested_domain.name)
self.assertContains(response, portfolio.organization_name)
@less_console_noise_decorator