refactored DomainAdmin response_change into multiple methods; updated create_user in common.py for properly setting is_staff for test users; added tearDown for TestDomainAdmin

This commit is contained in:
David Kennedy 2023-09-07 07:18:38 -04:00
parent 744c6fa48a
commit 5c41e4a28f
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
3 changed files with 42 additions and 30 deletions

View file

@ -41,6 +41,7 @@ class TestDomainAdmin(TestCase):
self.factory = RequestFactory()
self.admin = DomainAdmin(model=Domain, admin_site=self.site)
self.client = Client(HTTP_HOST="localhost:8080")
self.superuser = create_superuser()
self.staffuser = create_user()
def test_place_and_remove_hold(self):
@ -80,6 +81,10 @@ class TestDomainAdmin(TestCase):
self.assertContains(response, "Place hold")
self.assertNotContains(response, "Remove hold")
def tearDown(self):
Domain.objects.all().delete()
User.objects.all().delete()
class TestDomainApplicationAdmin(TestCase):
def setUp(self):