updated comments, updated test_models

This commit is contained in:
David Kennedy 2024-07-16 13:10:52 -04:00
parent bc75600202
commit a2558bd762
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
5 changed files with 233 additions and 158 deletions

View file

@ -42,6 +42,12 @@ logger = logging.getLogger(__name__)
@boto3_mocking.patching
class TestDomainRequestAdmin(MockEppLib):
"""Test DomainRequestAdmin class as either staff or super user.
Notes:
all tests share superuser/staffuser; do not change these models in tests
tests have available staffuser, superuser, client, admin and test_helper
"""
@classmethod
def setUpClass(self):
@ -61,6 +67,20 @@ class TestDomainRequestAdmin(MockEppLib):
)
self.mock_client = MockSESClient()
def tearDown(self):
super().tearDown()
Domain.objects.all().delete()
DomainInformation.objects.all().delete()
DomainRequest.objects.all().delete()
Contact.objects.all().delete()
Website.objects.all().delete()
self.mock_client.EMAILS_SENT.clear()
@classmethod
def tearDownClass(self):
super().tearDownClass()
User.objects.all().delete()
@less_console_noise_decorator
def test_has_model_description(self):
"""Tests if this model has a model description on the table view"""
@ -1854,18 +1874,4 @@ class TestDomainRequestAdmin(MockEppLib):
# Check if response contains expected_html
self.assertIn(expected_html, response_content)
def tearDown(self):
super().tearDown()
Domain.objects.all().delete()
DomainInformation.objects.all().delete()
DomainRequest.objects.all().delete()
Contact.objects.all().delete()
Website.objects.all().delete()
self.mock_client.EMAILS_SENT.clear()
@classmethod
def tearDownClass(self):
super().tearDownClass()
User.objects.all().delete()