Cleanup unit test

This commit is contained in:
zandercymatics 2024-06-06 13:00:35 -06:00
parent 1e1c1b2ac6
commit 173520b97b
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -1514,40 +1514,24 @@ class TestDomainRequestAdmin(MockEppLib):
self.assert_email_is_accurate("ORGANIZATION ALREADY HAS A .GOV DOMAIN", 0, EMAIL, True)
self.assertEqual(len(self.mock_client.EMAILS_SENT), 1)
# Revert back to in review to reset for the next assert
domain_request.status = DomainRequest.DomainRequestStatus.IN_REVIEW
domain_request.save()
# Test the email sent out for bad_name
bad_name = DomainRequest.ActionNeededReasons.BAD_NAME
self.transition_state_and_send_email(domain_request, action_needed, action_needed_reason=bad_name)
self.assert_email_is_accurate("DOMAIN NAME DOES NOT MEET .GOV REQUIREMENTS", 1, EMAIL, True)
self.assertEqual(len(self.mock_client.EMAILS_SENT), 2)
# Revert back to in review to reset for the next assert
domain_request.status = DomainRequest.DomainRequestStatus.IN_REVIEW
domain_request.save()
# Test the email sent out for eligibility_unclear
eligibility_unclear = DomainRequest.ActionNeededReasons.ELIGIBILITY_UNCLEAR
self.transition_state_and_send_email(domain_request, action_needed, action_needed_reason=eligibility_unclear)
self.assert_email_is_accurate("ORGANIZATION MAY NOT MEET ELIGIBILITY REQUIREMENTS", 2, EMAIL, True)
self.assertEqual(len(self.mock_client.EMAILS_SENT), 3)
# Revert back to in review to reset for the next assert
domain_request.status = DomainRequest.DomainRequestStatus.IN_REVIEW
domain_request.save()
# Test the email sent out for questionable_ao
questionable_ao = DomainRequest.ActionNeededReasons.QUESTIONABLE_AUTHORIZING_OFFICIAL
self.transition_state_and_send_email(domain_request, action_needed, action_needed_reason=questionable_ao)
self.assert_email_is_accurate("AUTHORIZING OFFICIAL DOES NOT MEET ELIGIBILITY REQUIREMENTS", 3, EMAIL, True)
self.assertEqual(len(self.mock_client.EMAILS_SENT), 4)
# Revert back to in review to reset for the next assert
domain_request.status = DomainRequest.DomainRequestStatus.IN_REVIEW
domain_request.save()
# Assert that no other emails are sent on OTHER
other = DomainRequest.ActionNeededReasons.OTHER
self.transition_state_and_send_email(domain_request, action_needed, action_needed_reason=other)