mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 02:36:02 +02:00
linter errors and test cleanup
This commit is contained in:
parent
a722d3c9c5
commit
172c5d31c5
5 changed files with 10 additions and 1033 deletions
|
@ -25,7 +25,7 @@ services:
|
|||
# Run Django in debug mode on local
|
||||
- DJANGO_DEBUG=True
|
||||
# Set DJANGO_LOG_LEVEL in env
|
||||
- DJANGO_LOG_LEVEL
|
||||
- DJANGO_LOG_LEVEL=DEBUG
|
||||
# Run Django without production flags
|
||||
- IS_PRODUCTION=False
|
||||
# Tell Django where it is being hosted
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -305,7 +305,7 @@ class TestDomainRequest(TestCase):
|
|||
@less_console_noise_decorator
|
||||
def test_submit_from_withdrawn_sends_email(self):
|
||||
msg = "Create a withdrawn domain request and submit it and see if email was sent."
|
||||
user, _ = User.objects.get_or_create(username="testy")
|
||||
user, _ = User.objects.get_or_create(username="testy", email="testy@town.com")
|
||||
domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.WITHDRAWN, user=user)
|
||||
self.check_email_sent(domain_request, msg, "submit", 1, expected_content="Hi", expected_email=user.email)
|
||||
|
||||
|
@ -324,14 +324,14 @@ class TestDomainRequest(TestCase):
|
|||
@less_console_noise_decorator
|
||||
def test_approve_sends_email(self):
|
||||
msg = "Create a domain request and approve it and see if email was sent."
|
||||
user, _ = User.objects.get_or_create(username="testy")
|
||||
user, _ = User.objects.get_or_create(username="testy", email="testy@town.com")
|
||||
domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.IN_REVIEW, user=user)
|
||||
self.check_email_sent(domain_request, msg, "approve", 1, expected_content="approved", expected_email=user.email)
|
||||
|
||||
@less_console_noise_decorator
|
||||
def test_withdraw_sends_email(self):
|
||||
msg = "Create a domain request and withdraw it and see if email was sent."
|
||||
user, _ = User.objects.get_or_create(username="testy")
|
||||
user, _ = User.objects.get_or_create(username="testy", email="testy@town.com")
|
||||
domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.IN_REVIEW, user=user)
|
||||
self.check_email_sent(
|
||||
domain_request, msg, "withdraw", 1, expected_content="withdrawn", expected_email=user.email
|
||||
|
@ -339,7 +339,7 @@ class TestDomainRequest(TestCase):
|
|||
|
||||
def test_reject_sends_email(self):
|
||||
"Create a domain request and reject it and see if email was sent."
|
||||
user, _ = User.objects.get_or_create(username="testy")
|
||||
user, _ = User.objects.get_or_create(username="testy", email="testy@town.com")
|
||||
domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.APPROVED, user=user)
|
||||
expected_email = user.email
|
||||
email_allowed, _ = AllowedEmail.objects.get_or_create(email=expected_email)
|
||||
|
|
|
@ -2099,7 +2099,6 @@ class TestDomainChangeNotifications(TestDomainOverview):
|
|||
# Check that an email was not sent
|
||||
self.assertFalse(self.mock_client.send_email.called)
|
||||
|
||||
|
||||
@boto3_mocking.patching
|
||||
@less_console_noise_decorator
|
||||
def test_notification_on_security_email_change(self):
|
||||
|
@ -2154,7 +2153,7 @@ class TestDomainChangeNotifications(TestDomainOverview):
|
|||
|
||||
self.assertIn("DOMAIN: igorville.gov", body)
|
||||
self.assertIn("UPDATED BY: First Last info@example.com", body)
|
||||
self.assertIn("INFORMATION UPDATED: DNSSec", body)
|
||||
self.assertIn("INFORMATION UPDATED: DNSSEC / DS Data", body)
|
||||
|
||||
@boto3_mocking.patching
|
||||
@less_console_noise_decorator
|
||||
|
|
|
@ -173,9 +173,9 @@ class DomainFormBaseView(DomainBaseView, FormMixin):
|
|||
SeniorOfficialContactForm,
|
||||
}
|
||||
|
||||
is_analyst_action = ("analyst_action" in self.session and "analyst_action_location" in self.session)
|
||||
is_analyst_action = "analyst_action" in self.session and "analyst_action_location" in self.session
|
||||
|
||||
should_notify=False
|
||||
should_notify = False
|
||||
|
||||
if form.__class__ in form_label_dict:
|
||||
if is_analyst_action:
|
||||
|
@ -206,9 +206,7 @@ class DomainFormBaseView(DomainBaseView, FormMixin):
|
|||
context,
|
||||
)
|
||||
else:
|
||||
logger.info(
|
||||
f"No notification sent for {form.__class__}. form changes: {form.has_changed()}, force_send: {force_send}"
|
||||
)
|
||||
logger.info(f"No notification sent for {form.__class__}.")
|
||||
|
||||
def email_domain_managers(self, domain: Domain, template: str, subject_template: str, context={}):
|
||||
"""Send a single email built from a template to all managers for a given domain.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue