mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 17:17:02 +02:00
Fix tests and AWS region setting
This commit is contained in:
parent
1fbd0506ff
commit
7b928a2761
4 changed files with 5 additions and 20 deletions
|
@ -216,6 +216,7 @@ AUTH_USER_MODEL = "registrar.User"
|
|||
# Configuration for accessing AWS SES
|
||||
AWS_ACCESS_KEY_ID = env.str("AWS_ACCESS_KEY_ID", None)
|
||||
AWS_SECRET_ACCESS_KEY = env.str("AWS_SECRET_ACCESS_KEY", None)
|
||||
AWS_REGION="us-gov-west-1"
|
||||
|
||||
# email address to use for various automated correspondence
|
||||
# TODO: pick something sensible here
|
||||
|
|
|
@ -78,32 +78,12 @@ class TestDomainApplication(TestCase):
|
|||
"""Create an application and submit it and see if email was sent."""
|
||||
user, _ = User.objects.get_or_create()
|
||||
contact = Contact.objects.create(email="test@test.gov")
|
||||
com_website, _ = Website.objects.get_or_create(website="igorville.com")
|
||||
gov_website, _ = Website.objects.get_or_create(website="igorville.gov")
|
||||
domain, _ = Domain.objects.get_or_create(name="igorville.gov")
|
||||
domain.save()
|
||||
application = DomainApplication.objects.create(
|
||||
creator=user,
|
||||
investigator=user,
|
||||
organization_type=DomainApplication.OrganizationChoices.FEDERAL,
|
||||
federal_type=DomainApplication.BranchChoices.EXECUTIVE,
|
||||
is_election_board=False,
|
||||
organization_name="Test",
|
||||
address_line1="100 Main St.",
|
||||
address_line2="APT 1A",
|
||||
state_territory="CA",
|
||||
zipcode="12345-6789",
|
||||
authorizing_official=contact,
|
||||
requested_domain=domain,
|
||||
submitter=contact,
|
||||
purpose="Igorville rules!",
|
||||
security_email="security@igorville.gov",
|
||||
anything_else="All of Igorville loves the dotgov program.",
|
||||
is_policy_acknowledged=True,
|
||||
)
|
||||
application.current_websites.add(com_website)
|
||||
application.alternative_domains.add(gov_website)
|
||||
application.other_contacts.add(contact)
|
||||
application.save()
|
||||
application.submit()
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ from django.urls import reverse
|
|||
from django.contrib.auth import get_user_model
|
||||
|
||||
from django_webtest import WebTest # type: ignore
|
||||
import boto3_mocking
|
||||
|
||||
from registrar.models import DomainApplication, Domain, Contact, Website
|
||||
from registrar.views.application import ApplicationWizard, Step
|
||||
|
@ -115,6 +116,7 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
|||
"What kind of U.S.-based government organization do you represent?", result
|
||||
)
|
||||
|
||||
@boto3_mocking.patching
|
||||
def test_application_form_submission(self):
|
||||
"""Can fill out the entire form and submit.
|
||||
As we add additional form pages, we need to include them here to make
|
||||
|
|
|
@ -18,8 +18,10 @@ def send_templated_email(template_name: str, to_address: str, context={}):
|
|||
|
||||
ses_client = boto3.client(
|
||||
"sesv2",
|
||||
region_name=settings.AWS_REGION,
|
||||
aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
|
||||
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
|
||||
|
||||
)
|
||||
ses_client.send_email(
|
||||
FromEmailAddress=settings.DEFAULT_FROM_EMAIL,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue