From 1b688b4abd220411669ad7243146dd2aa2f38559 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Mon, 18 Dec 2023 09:11:50 -0700 Subject: [PATCH] Update test_admin.py --- src/registrar/tests/test_admin.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index 9cd1d2bf7..a37544c36 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -947,6 +947,24 @@ class TestDomainApplicationAdmin(MockEppLib): unexpected_name = "BadGuy first_name:investigator BadGuy last_name:investigator" self.assertContains(response, unexpected_name, count=2) + def tearDown(self): + super().tearDown() + Domain.objects.all().delete() + DomainInformation.objects.all().delete() + DomainApplication.objects.all().delete() + User.objects.all().delete() + Contact.objects.all().delete() + Website.objects.all().delete() + + +class TestDomainApplicationAdminTable(MockEppLib): + """Tests the table for DomainApplicationAdmin""" + def setUp(self): + """Enables epplib patching, and creates a fake admin object""" + super().setUp() + self.site = AdminSite() + self.admin = DomainApplicationAdmin(model=DomainApplication, admin_site=self.site) + def test_table_sorted_alphabetically(self): """Tests if DomainApplicationAdmin table is sorted alphabetically""" # Creates a list of DomainApplications in scrambled order @@ -968,6 +986,7 @@ class TestDomainApplicationAdmin(MockEppLib): ) def tearDown(self): + """Delete all associated domain objects""" super().tearDown() Domain.objects.all().delete() DomainInformation.objects.all().delete()