mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-27 21:16:28 +02:00
updated test since helper text is not being used for a text field
This commit is contained in:
parent
f40ef08cba
commit
b51251ff3a
3 changed files with 5 additions and 23 deletions
|
@ -1766,7 +1766,7 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
"Contacts",
|
"Contacts",
|
||||||
{
|
{
|
||||||
"fields": [
|
"fields": [
|
||||||
"display_converted_senior_official",
|
"converted_senior_official",
|
||||||
"other_contacts",
|
"other_contacts",
|
||||||
"no_other_contacts_rationale",
|
"no_other_contacts_rationale",
|
||||||
"cisa_representative_first_name",
|
"cisa_representative_first_name",
|
||||||
|
@ -1832,7 +1832,7 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
"alternative_domains",
|
"alternative_domains",
|
||||||
"is_election_board",
|
"is_election_board",
|
||||||
"status_history",
|
"status_history",
|
||||||
"display_converted_senior_official",
|
"converted_senior_official",
|
||||||
"converted_federal_type",
|
"converted_federal_type",
|
||||||
"converted_federal_agency",
|
"converted_federal_agency",
|
||||||
"converted_state_territory",
|
"converted_state_territory",
|
||||||
|
@ -1878,21 +1878,6 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||||
|
|
||||||
change_form_template = "django/admin/domain_request_change_form.html"
|
change_form_template = "django/admin/domain_request_change_form.html"
|
||||||
|
|
||||||
def display_converted_senior_official(self, obj):
|
|
||||||
so = obj.converted_senior_official
|
|
||||||
if so:
|
|
||||||
parts = []
|
|
||||||
if so.first_name or so.last_name:
|
|
||||||
full_name = f"{so.first_name or ''} {so.last_name or ''}".strip()
|
|
||||||
parts.append(full_name)
|
|
||||||
if so.title:
|
|
||||||
parts.append(so.title)
|
|
||||||
if so.email:
|
|
||||||
parts.append(so.email)
|
|
||||||
if so.phone:
|
|
||||||
parts.append(str(so.phone))
|
|
||||||
return "\n\n".join(parts) if parts else "N/A"
|
|
||||||
|
|
||||||
# Trigger action when a fieldset is changed
|
# Trigger action when a fieldset is changed
|
||||||
def save_model(self, request, obj, form, change):
|
def save_model(self, request, obj, form, change):
|
||||||
"""Custom save_model definition that handles edge cases"""
|
"""Custom save_model definition that handles edge cases"""
|
||||||
|
|
|
@ -327,7 +327,7 @@ This is using a custom implementation fieldset.html (see admin/fieldset.html)
|
||||||
{% if not skip_additional_contact_info %}
|
{% if not skip_additional_contact_info %}
|
||||||
{% include "django/admin/includes/user_detail_list.html" with user=original_object.creator no_title_top_padding=field.is_readonly %}
|
{% include "django/admin/includes/user_detail_list.html" with user=original_object.creator no_title_top_padding=field.is_readonly %}
|
||||||
{% endif%}
|
{% endif%}
|
||||||
{% elif field.field.name == "senior_official" %}
|
{% elif field.field.name == "converted_senior_official" %}
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<label aria-label="Senior official contact details"></label>
|
<label aria-label="Senior official contact details"></label>
|
||||||
{% include "django/admin/includes/contact_detail_list.html" with user=original_object.senior_official no_title_top_padding=field.is_readonly %}
|
{% include "django/admin/includes/contact_detail_list.html" with user=original_object.senior_official no_title_top_padding=field.is_readonly %}
|
||||||
|
|
|
@ -160,7 +160,6 @@ class TestDomainRequestAdmin(MockEppLib):
|
||||||
("no_other_contacts_rationale", "Required if creator does not list other employees"),
|
("no_other_contacts_rationale", "Required if creator does not list other employees"),
|
||||||
("alternative_domains", "Other domain names the creator provided for consideration"),
|
("alternative_domains", "Other domain names the creator provided for consideration"),
|
||||||
("no_other_contacts_rationale", "Required if creator does not list other employees"),
|
("no_other_contacts_rationale", "Required if creator does not list other employees"),
|
||||||
("Urbanization", "Required for Puerto Rico only"),
|
|
||||||
]
|
]
|
||||||
self.test_helper.assert_response_contains_distinct_values(response, expected_values)
|
self.test_helper.assert_response_contains_distinct_values(response, expected_values)
|
||||||
|
|
||||||
|
@ -1508,8 +1507,6 @@ class TestDomainRequestAdmin(MockEppLib):
|
||||||
self.assertContains(response, "Meoward Jones")
|
self.assertContains(response, "Meoward Jones")
|
||||||
|
|
||||||
# == Check for the senior_official == #
|
# == Check for the senior_official == #
|
||||||
print("SENIOR OFFICIAL")
|
|
||||||
print(response.content.decode("utf-8"))
|
|
||||||
self.assertContains(response, "testy@town.com", count=2)
|
self.assertContains(response, "testy@town.com", count=2)
|
||||||
expected_so_fields = [
|
expected_so_fields = [
|
||||||
# Field, expected value
|
# Field, expected value
|
||||||
|
@ -1696,7 +1693,7 @@ class TestDomainRequestAdmin(MockEppLib):
|
||||||
"alternative_domains",
|
"alternative_domains",
|
||||||
"is_election_board",
|
"is_election_board",
|
||||||
"status_history",
|
"status_history",
|
||||||
"federal_agency",
|
"converted_federal_agency",
|
||||||
"creator",
|
"creator",
|
||||||
"about_your_organization",
|
"about_your_organization",
|
||||||
"requested_domain",
|
"requested_domain",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue