A few updates based on feedback

This commit is contained in:
CocoByte 2024-12-02 13:00:47 -07:00
parent 6ca53560ea
commit a6308edffe
No known key found for this signature in database
GPG key ID: BBFAA2526384C97F
3 changed files with 7 additions and 11 deletions

View file

@ -491,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"""

View file

@ -326,7 +326,6 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
# spaces and leading/trailing whitespace # spaces and leading/trailing whitespace
csv_content = csv_content.replace(",,", "").replace(",", "").replace(" ", "").replace("\r\n", "\n").strip() csv_content = csv_content.replace(",,", "").replace(",", "").replace(" ", "").replace("\r\n", "\n").strip()
expected_content = expected_content.replace(",,", "").replace(",", "").replace(" ", "").strip() expected_content = expected_content.replace(",,", "").replace(",", "").replace(" ", "").strip()
self.maxDiff = None self.maxDiff = None
self.assertEqual(csv_content, expected_content) self.assertEqual(csv_content, expected_content)
@ -509,7 +508,7 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
self.maxDiff = None self.maxDiff = None
self.assertEqual(csv_content, expected_content) self.assertEqual(csv_content, expected_content)
# @less_console_noise_decorator @less_console_noise_decorator
def test_domain_data_federal(self): def test_domain_data_federal(self):
"""Shows security contacts, filtered by state and org type""" """Shows security contacts, filtered by state and org type"""
# Add security email information # Add security email information
@ -606,7 +605,6 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
csv_content.replace(",,", "").replace(",", "").replace(" ", "").replace("\r\n", "\n").strip() csv_content.replace(",,", "").replace(",", "").replace(" ", "").replace("\r\n", "\n").strip()
) )
expected_content = expected_content.replace(",,", "").replace(",", "").replace(" ", "").strip() expected_content = expected_content.replace(",,", "").replace(",", "").replace(" ", "").strip()
self.assertEqual(csv_content, expected_content) self.assertEqual(csv_content, expected_content)
@less_console_noise_decorator @less_console_noise_decorator
@ -689,7 +687,6 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
# spaces and leading/trailing whitespace # spaces and leading/trailing whitespace
csv_content = csv_content.replace(",,", "").replace(",", "").replace(" ", "").replace("\r\n", "\n").strip() csv_content = csv_content.replace(",,", "").replace(",", "").replace(" ", "").replace("\r\n", "\n").strip()
expected_content = expected_content.replace(",,", "").replace(",", "").replace(" ", "").strip() expected_content = expected_content.replace(",,", "").replace(",", "").replace(" ", "").strip()
self.assertEqual(csv_content, expected_content) self.assertEqual(csv_content, expected_content)
@less_console_noise_decorator @less_console_noise_decorator
@ -727,7 +724,6 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
# spaces and leading/trailing whitespace # spaces and leading/trailing whitespace
csv_content = csv_content.replace(",,", "").replace(",", "").replace(" ", "").replace("\r\n", "\n").strip() csv_content = csv_content.replace(",,", "").replace(",", "").replace(" ", "").replace("\r\n", "\n").strip()
expected_content = expected_content.replace(",,", "").replace(",", "").replace(" ", "").strip() expected_content = expected_content.replace(",,", "").replace(",", "").replace(" ", "").strip()
self.assertEqual(csv_content, expected_content) self.assertEqual(csv_content, expected_content)
@less_console_noise_decorator @less_console_noise_decorator

View file

@ -138,7 +138,7 @@ class BaseExport(ABC):
return Q() return Q()
@classmethod @classmethod
def get_computed_fields(cls, **kwargs): def get_computed_fields(cls, delimiter=", ", **kwargs):
""" """
Get a dict of computed fields. These are fields that do not exist on the model normally Get a dict of computed fields. These are fields that do not exist on the model normally
and will be passed to .annotate() when building a queryset. and will be passed to .annotate() when building a queryset.
@ -526,7 +526,7 @@ class DomainExport(BaseExport):
return DomainInformation return DomainInformation
@classmethod @classmethod
def get_computed_fields(cls, delimiter=", "): def get_computed_fields(cls, delimiter=", ", **kwargs):
""" """
Get a dict of computed fields. Get a dict of computed fields.
""" """
@ -612,7 +612,7 @@ class DomainExport(BaseExport):
"converted_so_name": Case( "converted_so_name": Case(
# When portfolio is present, use that senior official instead # When portfolio is present, use that senior official instead
When( When(
portfolio__isnull=False, Q(portfolio__isnull=False) & Q(portfolio__senior_official__isnull=False),
then=Concat( then=Concat(
Coalesce(F("portfolio__senior_official__first_name"), Value("")), Coalesce(F("portfolio__senior_official__first_name"), Value("")),
Value(" "), Value(" "),
@ -1615,7 +1615,7 @@ class DomainRequestExport(BaseExport):
) )
@classmethod @classmethod
def get_computed_fields(cls, delimiter=", "): def get_computed_fields(cls, delimiter=", ", **kwargs):
""" """
Get a dict of computed fields. Get a dict of computed fields.
""" """
@ -1701,7 +1701,7 @@ class DomainRequestExport(BaseExport):
"converted_so_name": Case( "converted_so_name": Case(
# When portfolio is present, use that senior official instead # When portfolio is present, use that senior official instead
When( When(
portfolio__isnull=False, Q(portfolio__isnull=False) & Q(portfolio__senior_official__isnull=False),
then=Concat( then=Concat(
Coalesce(F("portfolio__senior_official__first_name"), Value("")), Coalesce(F("portfolio__senior_official__first_name"), Value("")),
Value(" "), Value(" "),