mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 17:47:02 +02:00
Test fix
This commit is contained in:
parent
3beb23262b
commit
0978c91450
2 changed files with 9 additions and 12 deletions
|
@ -4,7 +4,6 @@ from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.http.response import HttpResponseRedirect
|
from django.http.response import HttpResponseRedirect
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from registrar.models.domain_application import DomainApplication
|
|
||||||
from registrar.models.utility.admin_form_order_helper import (
|
from registrar.models.utility.admin_form_order_helper import (
|
||||||
AdminFormOrderHelper,
|
AdminFormOrderHelper,
|
||||||
SortingDict,
|
SortingDict,
|
||||||
|
@ -23,7 +22,7 @@ foreignkey_orderby_dict: list[SortingDict] = [
|
||||||
),
|
),
|
||||||
# Handles fields that are sorted by 'name'
|
# Handles fields that are sorted by 'name'
|
||||||
SortingDict(["domain", "requested_domain"], ["name"]),
|
SortingDict(["domain", "requested_domain"], ["name"]),
|
||||||
SortingDict(['domain_application'], ['requested_domain__name']),
|
SortingDict(["domain_application"], ["requested_domain__name"]),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ from registrar.models import (
|
||||||
DomainApplication,
|
DomainApplication,
|
||||||
DomainInformation,
|
DomainInformation,
|
||||||
User,
|
User,
|
||||||
Contact,
|
|
||||||
DomainInvitation,
|
DomainInvitation,
|
||||||
)
|
)
|
||||||
from .common import (
|
from .common import (
|
||||||
|
@ -431,7 +430,6 @@ class AuditedAdminTest(TestCase):
|
||||||
|
|
||||||
model_admin = AuditedAdmin(DomainApplication, self.site)
|
model_admin = AuditedAdmin(DomainApplication, self.site)
|
||||||
|
|
||||||
|
|
||||||
sorted_fields = []
|
sorted_fields = []
|
||||||
# Typically we wouldn't want two nested for fields,
|
# Typically we wouldn't want two nested for fields,
|
||||||
# but both fields are of a fixed length.
|
# but both fields are of a fixed length.
|
||||||
|
@ -480,8 +478,8 @@ class AuditedAdminTest(TestCase):
|
||||||
DomainInformation.authorizing_official.field,
|
DomainInformation.authorizing_official.field,
|
||||||
DomainInformation.submitter.field,
|
DomainInformation.submitter.field,
|
||||||
DomainInformation.creator.field,
|
DomainInformation.creator.field,
|
||||||
(DomainInformation.domain.field, ['name']),
|
(DomainInformation.domain.field, ["name"]),
|
||||||
(DomainInformation.domain_application.field, ['requested_domain__name']),
|
(DomainInformation.domain_application.field, ["requested_domain__name"]),
|
||||||
]
|
]
|
||||||
# Creates multiple domain applications - review status does not matter
|
# Creates multiple domain applications - review status does not matter
|
||||||
applications = multiple_unalphabetical_domain_objects("information")
|
applications = multiple_unalphabetical_domain_objects("information")
|
||||||
|
@ -521,19 +519,19 @@ class AuditedAdminTest(TestCase):
|
||||||
# return lists of different types/structures.
|
# return lists of different types/structures.
|
||||||
# We need to parse this data and coerce them into the same type.
|
# We need to parse this data and coerce them into the same type.
|
||||||
for obj in current_sort_order:
|
for obj in current_sort_order:
|
||||||
|
last = None
|
||||||
if not isOtherOrderfield:
|
if not isOtherOrderfield:
|
||||||
first = obj.first_name
|
first = obj.first_name
|
||||||
last = obj.last_name
|
last = obj.last_name
|
||||||
elif field_obj == DomainInformation.domain.field:
|
elif field_obj == DomainInformation.domain.field:
|
||||||
first = obj.name
|
first = obj.name
|
||||||
last = None
|
elif field_obj == DomainInformation.domain_application.field:
|
||||||
elif field_obj.name == DomainInformation.domain_application.field:
|
first = obj.requested_domain.name
|
||||||
first = obj.requested_domain
|
|
||||||
last = None
|
|
||||||
|
|
||||||
name_tuple = self.coerced_fk_field_helper(first, last, field_obj.name, ":")
|
name_tuple = self.coerced_fk_field_helper(
|
||||||
|
first, last, field_obj.name, ":"
|
||||||
|
)
|
||||||
if name_tuple is not None:
|
if name_tuple is not None:
|
||||||
logger.debug(name_tuple)
|
|
||||||
current_sort_order_coerced_type.append(name_tuple)
|
current_sort_order_coerced_type.append(name_tuple)
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue