Cleanup + (mostly) fix tests

This commit is contained in:
zandercymatics 2024-06-20 12:44:22 -06:00
parent 4c84ad8456
commit 3441a3974f
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
7 changed files with 41 additions and 12 deletions

View file

@ -1595,6 +1595,29 @@ class TestDomainRequestAdmin(MockEppLib):
# Test Submitted Status Again from in ACTION_NEEDED, no new email should be sent
self.transition_state_and_send_email(domain_request, DomainRequest.DomainRequestStatus.SUBMITTED)
self.assertEqual(len(self.mock_client.EMAILS_SENT), 3)
@less_console_noise_decorator
def test_model_displays_action_needed_email(self):
"""Tests if the action needed email is visible for Domain Requests"""
_domain_request = completed_domain_request(
status=DomainRequest.DomainRequestStatus.ACTION_NEEDED,
action_needed_reason=DomainRequest.ActionNeededReasons.BAD_NAME
)
p = "userpass"
self.client.login(username="staffuser", password=p)
response = self.client.get(
"/admin/registrar/domainrequest/{}/change/".format(_domain_request.pk),
follow=True,
)
self.assertContains(response, "DOMAIN NAME DOES NOT MEET .GOV REQUIREMENTS")
_domain_request.action_needed_reason = DomainRequest.ActionNeededReasons.OTHER
_domain_request.save()
self.assertContains(response, "No email will be sent")
@override_settings(IS_PRODUCTION=True)
def test_save_model_sends_submitted_email_with_bcc_on_prod(self):
@ -2290,6 +2313,7 @@ class TestDomainRequestAdmin(MockEppLib):
"status",
"rejection_reason",
"action_needed_reason",
"action_needed_reason_email",
"federal_agency",
"portfolio",
"creator",