Update test_admin.py

This commit is contained in:
zandercymatics 2023-12-18 09:11:50 -07:00
parent 5e19ad1b15
commit 1b688b4abd
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -947,6 +947,24 @@ class TestDomainApplicationAdmin(MockEppLib):
unexpected_name = "BadGuy first_name:investigator BadGuy last_name:investigator" unexpected_name = "BadGuy first_name:investigator BadGuy last_name:investigator"
self.assertContains(response, unexpected_name, count=2) 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): def test_table_sorted_alphabetically(self):
"""Tests if DomainApplicationAdmin table is sorted alphabetically""" """Tests if DomainApplicationAdmin table is sorted alphabetically"""
# Creates a list of DomainApplications in scrambled order # Creates a list of DomainApplications in scrambled order
@ -968,6 +986,7 @@ class TestDomainApplicationAdmin(MockEppLib):
) )
def tearDown(self): def tearDown(self):
"""Delete all associated domain objects"""
super().tearDown() super().tearDown()
Domain.objects.all().delete() Domain.objects.all().delete()
DomainInformation.objects.all().delete() DomainInformation.objects.all().delete()