fixes for unit test (and admin change form)

This commit is contained in:
CocoByte 2024-11-26 13:31:01 -07:00
parent c0a0ac3ed2
commit 36c19d65bf
No known key found for this signature in database
GPG key ID: BBFAA2526384C97F
2 changed files with 5 additions and 8 deletions

View file

@ -1579,7 +1579,7 @@ class DomainInformationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
}, },
), ),
(".gov domain", {"fields": ["domain"]}), (".gov domain", {"fields": ["domain"]}),
("Contacts", {"fields": ["generic_org_type", "other_contacts", "no_other_contacts_rationale"]}), ("Contacts", {"fields": ["senior_official", "other_contacts", "no_other_contacts_rationale"]}),
("Background info", {"fields": ["anything_else"]}), ("Background info", {"fields": ["anything_else"]}),
( (
"Type of organization", "Type of organization",

View file

@ -32,9 +32,6 @@ from unittest.mock import ANY, call, patch
import boto3_mocking # type: ignore import boto3_mocking # type: ignore
import logging import logging
logger = logging.getLogger(__name__)
class TestDomainAdminAsStaff(MockEppLib): class TestDomainAdminAsStaff(MockEppLib):
"""Test DomainAdmin class as staff user. """Test DomainAdmin class as staff user.
@ -494,7 +491,7 @@ class TestDomainAdminWithClient(TestCase):
self.assertContains(response, "This table contains all approved domains in the .gov registrar.") self.assertContains(response, "This table contains all approved domains in the .gov registrar.")
self.assertContains(response, "Show more") self.assertContains(response, "Show more")
@less_console_noise_decorator # @less_console_noise_decorator
def test_contact_fields_on_domain_change_form_have_detail_table(self): def test_contact_fields_on_domain_change_form_have_detail_table(self):
"""Tests if the contact fields in the inlined Domain information have the detail table """Tests if the contact fields in the inlined Domain information have the detail table
which displays title, email, and phone""" which displays title, email, and phone"""
@ -726,9 +723,9 @@ class TestDomainAdminWithClient(TestCase):
domain_request.approve() domain_request.approve()
response = self.client.get("/admin/registrar/domain/") response = self.client.get("/admin/registrar/domain/")
# There are 4 template references to Federal (4) plus four references in the table # The total count should reflect the fact that we are pulling from portfolio
# for our actual domain_request # data when portfolios are present
self.assertContains(response, "Federal", count=56) self.assertContains(response, "Federal", count=98)
# This may be a bit more robust # This may be a bit more robust
self.assertContains(response, '<td class="field-generic_org_type">Federal</td>', count=1) self.assertContains(response, '<td class="field-generic_org_type">Federal</td>', count=1)
# Now let's make sure the long description does not exist # Now let's make sure the long description does not exist