mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-02 02:28:32 +02:00
Remove unused test
This commit is contained in:
parent
ce1101ae18
commit
e1d052878a
2 changed files with 3 additions and 41 deletions
|
@ -655,8 +655,8 @@ class DomainApplication(TimeStampedModel):
|
||||||
|
|
||||||
This action is logged."""
|
This action is logged."""
|
||||||
literal = DomainApplication.ApplicationStatus.IN_REVIEW
|
literal = DomainApplication.ApplicationStatus.IN_REVIEW
|
||||||
# Check if the tuple is setup correctly, then grab its value
|
# Check if the tuple exists, then grab its value
|
||||||
in_review = literal[1] if literal and len(literal) > 1 else "In Review"
|
in_review = literal if literal is not None else "In Review"
|
||||||
logger.info(f"A status change occurred. {self} was changed to '{in_review}'")
|
logger.info(f"A status change occurred. {self} was changed to '{in_review}'")
|
||||||
|
|
||||||
@transition(
|
@transition(
|
||||||
|
@ -675,7 +675,7 @@ class DomainApplication(TimeStampedModel):
|
||||||
This action is logged."""
|
This action is logged."""
|
||||||
literal = DomainApplication.ApplicationStatus.ACTION_NEEDED
|
literal = DomainApplication.ApplicationStatus.ACTION_NEEDED
|
||||||
# Check if the tuple is setup correctly, then grab its value
|
# Check if the tuple is setup correctly, then grab its value
|
||||||
action_needed = literal[1] if literal and len(literal) > 1 else "Action Needed"
|
action_needed = literal if literal is not None else "Action Needed"
|
||||||
logger.info(f"A status change occurred. {self} was changed to '{action_needed}'")
|
logger.info(f"A status change occurred. {self} was changed to '{action_needed}'")
|
||||||
|
|
||||||
@transition(
|
@transition(
|
||||||
|
|
|
@ -457,44 +457,6 @@ class TestDomainApplicationAdmin(MockEppLib):
|
||||||
|
|
||||||
self.assertEqual(len(self.mock_client.EMAILS_SENT), 1)
|
self.assertEqual(len(self.mock_client.EMAILS_SENT), 1)
|
||||||
|
|
||||||
@boto3_mocking.patching
|
|
||||||
def test_save_model_sends_in_review_email(self):
|
|
||||||
# make sure there is no user with this email
|
|
||||||
EMAIL = "mayor@igorville.gov"
|
|
||||||
User.objects.filter(email=EMAIL).delete()
|
|
||||||
|
|
||||||
with boto3_mocking.clients.handler_for("sesv2", self.mock_client):
|
|
||||||
with less_console_noise():
|
|
||||||
# Create a sample application
|
|
||||||
application = completed_application(status=DomainApplication.ApplicationStatus.SUBMITTED)
|
|
||||||
|
|
||||||
# Create a mock request
|
|
||||||
request = self.factory.post("/admin/registrar/domainapplication/{}/change/".format(application.pk))
|
|
||||||
|
|
||||||
# Modify the application's property
|
|
||||||
application.status = DomainApplication.ApplicationStatus.IN_REVIEW
|
|
||||||
|
|
||||||
# Use the model admin's save_model method
|
|
||||||
self.admin.save_model(request, application, form=None, change=True)
|
|
||||||
|
|
||||||
# Access the arguments passed to send_email
|
|
||||||
call_args = self.mock_client.EMAILS_SENT
|
|
||||||
kwargs = call_args[0]["kwargs"]
|
|
||||||
|
|
||||||
# Retrieve the email details from the arguments
|
|
||||||
from_email = kwargs.get("FromEmailAddress")
|
|
||||||
to_email = kwargs["Destination"]["ToAddresses"][0]
|
|
||||||
email_content = kwargs["Content"]
|
|
||||||
email_body = email_content["Simple"]["Body"]["Text"]["Data"]
|
|
||||||
|
|
||||||
# Assert or perform other checks on the email details
|
|
||||||
expected_string = "Your .gov domain request is being reviewed."
|
|
||||||
self.assertEqual(from_email, settings.DEFAULT_FROM_EMAIL)
|
|
||||||
self.assertEqual(to_email, EMAIL)
|
|
||||||
self.assertIn(expected_string, email_body)
|
|
||||||
|
|
||||||
self.assertEqual(len(self.mock_client.EMAILS_SENT), 1)
|
|
||||||
|
|
||||||
@boto3_mocking.patching
|
@boto3_mocking.patching
|
||||||
def test_save_model_sends_approved_email(self):
|
def test_save_model_sends_approved_email(self):
|
||||||
# make sure there is no user with this email
|
# make sure there is no user with this email
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue