diff --git a/src/registrar/tests/common.py b/src/registrar/tests/common.py index 40d5108f4..ea2462dfb 100644 --- a/src/registrar/tests/common.py +++ b/src/registrar/tests/common.py @@ -918,14 +918,7 @@ def completed_domain_request( # noqa domain, _ = DraftDomain.objects.get_or_create(name=name) alt, _ = Website.objects.get_or_create(website="city1.gov") current, _ = Website.objects.get_or_create(website="city.com") - # if not creator: - # creator, _ = Contact.objects.get_or_create( - # first_name="Testy2", - # last_name="Tester2", - # title="Admin Tester", - # email="mayor@igorville.gov", - # phone="(555) 555 5556", - # ) + creator = user other, _ = Contact.objects.get_or_create( first_name="Testy", last_name="Tester", diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index f69c37947..4cce3ed14 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -1653,91 +1653,6 @@ class TestContactAdmin(TestCase): self.assertEqual(readonly_fields, expected_fields) - def test_change_view_for_joined_contact_five_or_less(self): - """Create a contact, join it to 4 domain requests. - Assert that the warning on the contact form lists 4 joins.""" - with less_console_noise(): - self.client.force_login(self.superuser) - - # Create an instance of the model - contact, _ = Contact.objects.get_or_create( - first_name="Henry", - last_name="McFakerson", - ) - - # join it to 4 domain requests. - domain_request1 = completed_domain_request(name="city1.gov") - domain_request2 = completed_domain_request(name="city2.gov") - domain_request3 = completed_domain_request(name="city3.gov") - domain_request4 = completed_domain_request(name="city4.gov") - - with patch("django.contrib.messages.warning") as mock_warning: - # Use the test client to simulate the request - response = self.client.get(reverse("admin:registrar_contact_change", args=[contact.pk])) - - # Assert that the error message was called with the correct argument - # Note: The 5th join will be a user. - mock_warning.assert_called_once_with( - response.wsgi_request, - "
", - ) - - # cleanup this test - DomainRequest.objects.all().delete() - contact.delete() - - def test_change_view_for_joined_contact_five_or_more(self): - """Create a contact, join it to 6 domain requests. - Assert that the warning on the contact form lists 5 joins and a '1 more' ellispsis.""" - with less_console_noise(): - self.client.force_login(self.superuser) - # Create an instance of the model - # join it to 6 domain requests. - contact, _ = Contact.objects.get_or_create( - first_name="Henry", - last_name="McFakerson", - ) - domain_request1 = completed_domain_request(name="city1.gov") - domain_request2 = completed_domain_request(name="city2.gov") - domain_request3 = completed_domain_request(name="city3.gov") - domain_request4 = completed_domain_request(name="city4.gov") - domain_request5 = completed_domain_request(name="city5.gov") - completed_domain_request(name="city6.gov") - with patch("django.contrib.messages.warning") as mock_warning: - # Use the test client to simulate the request - response = self.client.get(reverse("admin:registrar_contact_change", args=[contact.pk])) - logger.debug(mock_warning) - # Assert that the error message was called with the correct argument - # Note: The 6th join will be a user. - mock_warning.assert_called_once_with( - response.wsgi_request, - " " - "And 1 more...
", - ) - # cleanup this test - DomainRequest.objects.all().delete() - contact.delete() - class TestVerifiedByStaffAdmin(TestCase):