mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-18 18:39:21 +02:00
remove submitter from orphan tests
This commit is contained in:
parent
06ef54f031
commit
804d19f30e
3 changed files with 3 additions and 24 deletions
|
@ -35,6 +35,7 @@ from .common import (
|
||||||
GenericTestHelper,
|
GenericTestHelper,
|
||||||
)
|
)
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
from waffle.testutils import override_flag
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
import boto3_mocking # type: ignore
|
import boto3_mocking # type: ignore
|
||||||
|
@ -149,7 +150,7 @@ class TestDomainRequestAdmin(MockEppLib):
|
||||||
|
|
||||||
# These should exist in the response
|
# These should exist in the response
|
||||||
expected_values = [
|
expected_values = [
|
||||||
("creator", "Person who submitted the domain request; will receive email updates"),
|
("creator", "Person who submitted the domain request. Will receive email updates"),
|
||||||
("approved_domain", "Domain associated with this request; will be blank until request is approved"),
|
("approved_domain", "Domain associated with this request; will be blank until request is approved"),
|
||||||
("no_other_contacts_rationale", "Required if creator does not list other employees"),
|
("no_other_contacts_rationale", "Required if creator does not list other employees"),
|
||||||
("alternative_domains", "Other domain names the creator provided for consideration"),
|
("alternative_domains", "Other domain names the creator provided for consideration"),
|
||||||
|
@ -894,6 +895,7 @@ class TestDomainRequestAdmin(MockEppLib):
|
||||||
self.transition_state_and_send_email(domain_request, DomainRequest.DomainRequestStatus.SUBMITTED)
|
self.transition_state_and_send_email(domain_request, DomainRequest.DomainRequestStatus.SUBMITTED)
|
||||||
self.assertEqual(len(self.mock_client.EMAILS_SENT), 3)
|
self.assertEqual(len(self.mock_client.EMAILS_SENT), 3)
|
||||||
|
|
||||||
|
@override_flag("profile_feature", True)
|
||||||
@less_console_noise_decorator
|
@less_console_noise_decorator
|
||||||
def test_save_model_sends_approved_email(self):
|
def test_save_model_sends_approved_email(self):
|
||||||
"""When transitioning to approved on a domain request,
|
"""When transitioning to approved on a domain request,
|
||||||
|
|
|
@ -69,7 +69,6 @@ class TestEmails(TestCase):
|
||||||
|
|
||||||
# check for optional things
|
# check for optional things
|
||||||
self.assertIn("Other employees from your organization:", body)
|
self.assertIn("Other employees from your organization:", body)
|
||||||
self.assertIn("Testy2 Tester2", body)
|
|
||||||
self.assertIn("Current websites:", body)
|
self.assertIn("Current websites:", body)
|
||||||
self.assertIn("city.com", body)
|
self.assertIn("city.com", body)
|
||||||
self.assertIn("About your organization:", body)
|
self.assertIn("About your organization:", body)
|
||||||
|
|
|
@ -358,10 +358,6 @@ class HomeTests(TestWithUser):
|
||||||
first_name="Henry",
|
first_name="Henry",
|
||||||
last_name="Mcfakerson",
|
last_name="Mcfakerson",
|
||||||
)
|
)
|
||||||
contact_shared = Contact.objects.create(
|
|
||||||
first_name="Relative",
|
|
||||||
last_name="Aether",
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create two non-orphaned contacts
|
# Create two non-orphaned contacts
|
||||||
contact_2 = Contact.objects.create(
|
contact_2 = Contact.objects.create(
|
||||||
|
@ -369,12 +365,6 @@ class HomeTests(TestWithUser):
|
||||||
last_name="Mars",
|
last_name="Mars",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Attach a user object to a contact (should not be deleted)
|
|
||||||
contact_user, _ = Contact.objects.get_or_create(
|
|
||||||
first_name="Hank",
|
|
||||||
last_name="McFakey",
|
|
||||||
)
|
|
||||||
|
|
||||||
site = DraftDomain.objects.create(name="igorville.gov")
|
site = DraftDomain.objects.create(name="igorville.gov")
|
||||||
domain_request = DomainRequest.objects.create(
|
domain_request = DomainRequest.objects.create(
|
||||||
creator=self.user,
|
creator=self.user,
|
||||||
|
@ -407,8 +397,6 @@ class HomeTests(TestWithUser):
|
||||||
# Check if the orphaned contacts were deleted
|
# Check if the orphaned contacts were deleted
|
||||||
orphan = Contact.objects.filter(id=contact.id)
|
orphan = Contact.objects.filter(id=contact.id)
|
||||||
self.assertFalse(orphan.exists())
|
self.assertFalse(orphan.exists())
|
||||||
orphan = Contact.objects.filter(id=contact_user.id)
|
|
||||||
self.assertFalse(orphan.exists())
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
edge_case = Contact.objects.filter(id=contact_2.id).get()
|
edge_case = Contact.objects.filter(id=contact_2.id).get()
|
||||||
|
@ -430,10 +418,6 @@ class HomeTests(TestWithUser):
|
||||||
first_name="Henry",
|
first_name="Henry",
|
||||||
last_name="Mcfakerson",
|
last_name="Mcfakerson",
|
||||||
)
|
)
|
||||||
contact_shared = Contact.objects.create(
|
|
||||||
first_name="Relative",
|
|
||||||
last_name="Aether",
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create two non-orphaned contacts
|
# Create two non-orphaned contacts
|
||||||
contact_2 = Contact.objects.create(
|
contact_2 = Contact.objects.create(
|
||||||
|
@ -441,12 +425,6 @@ class HomeTests(TestWithUser):
|
||||||
last_name="Mars",
|
last_name="Mars",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Attach a user object to a contact (should not be deleted)
|
|
||||||
contact_user, _ = Contact.objects.get_or_create(
|
|
||||||
first_name="Hank",
|
|
||||||
last_name="McFakey",
|
|
||||||
)
|
|
||||||
|
|
||||||
site = DraftDomain.objects.create(name="igorville.gov")
|
site = DraftDomain.objects.create(name="igorville.gov")
|
||||||
domain_request = DomainRequest.objects.create(
|
domain_request = DomainRequest.objects.create(
|
||||||
creator=self.user,
|
creator=self.user,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue