Change test order

This commit is contained in:
zandercymatics 2023-12-15 15:16:39 -07:00
parent b64fa2410c
commit fa0beb1f8d
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -843,26 +843,6 @@ class TestDomainApplicationAdmin(MockEppLib):
with self.assertRaises(DomainInformation.DoesNotExist):
domain_information.refresh_from_db()
def test_table_sorted_alphabetically(self):
"""Tests if DomainApplicationAdmin table is sorted alphabetically"""
# Creates a list of DomainApplications in scrambled order
multiple_unalphabetical_domain_objects("application")
request = self.factory.get("/")
request.user = self.superuser
# Get the expected list of alphabetically sorted DomainApplications
expected_order = DomainApplication.objects.order_by("requested_domain__name")
# Get the returned queryset
queryset = self.admin.get_queryset(request)
# Check the order
self.assertEqual(
list(queryset),
list(expected_order),
)
def test_has_correct_filters(self):
"""Tests if DomainApplicationAdmin has the correct filters"""
request = self.factory.get("/")
@ -965,6 +945,26 @@ class TestDomainApplicationAdmin(MockEppLib):
unexpected_name = "BadGuy first_name:investigator BadGuy last_name:investigator"
self.assertContains(response, unexpected_name, count=2)
def test_table_sorted_alphabetically(self):
"""Tests if DomainApplicationAdmin table is sorted alphabetically"""
# Creates a list of DomainApplications in scrambled order
multiple_unalphabetical_domain_objects("application")
request = self.factory.get("/")
request.user = self.superuser
# Get the expected list of alphabetically sorted DomainApplications
expected_order = DomainApplication.objects.order_by("requested_domain__name")
# Get the returned queryset
queryset = self.admin.get_queryset(request)
# Check the order
self.assertEqual(
list(queryset),
list(expected_order),
)
def tearDown(self):
super().tearDown()
Domain.objects.all().delete()