This commit is contained in:
zandercymatics 2024-02-26 15:10:03 -07:00
parent 3d6f638462
commit 92c85dbb16
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 3 additions and 12 deletions

View file

@ -52,7 +52,7 @@ class TestDomainApplication(TestCase):
status=DomainApplication.ApplicationStatus.INELIGIBLE, name="ineligible.gov" status=DomainApplication.ApplicationStatus.INELIGIBLE, name="ineligible.gov"
) )
# Store all aplpication statuses in a variable for ease of use # Store all application statuses in a variable for ease of use
self.all_applications = [ self.all_applications = [
self.started_application, self.started_application,
self.submitted_application, self.submitted_application,
@ -181,14 +181,7 @@ class TestDomainApplication(TestCase):
with less_console_noise(): with less_console_noise():
# Perform the specified action # Perform the specified action
action_method = getattr(application, action) action_method = getattr(application, action)
if action == "approve" and not application.investigator: action_method()
user, _ = User.objects.get_or_create(username="testwafflesyrup", is_staff=True)
application.investigator = user
application.save()
application.refresh_from_db()
action_method()
else:
action_method()
# Check if an email was sent # Check if an email was sent
sent_emails = [ sent_emails = [

View file

@ -100,9 +100,7 @@ class ApplicationStatusError(Exception):
FSMErrorCodes.APPROVE_DOMAIN_IN_USE: ("Cannot approve. Requested domain is already in use."), FSMErrorCodes.APPROVE_DOMAIN_IN_USE: ("Cannot approve. Requested domain is already in use."),
FSMErrorCodes.NO_INVESTIGATOR: ("No investigator was assigned."), FSMErrorCodes.NO_INVESTIGATOR: ("No investigator was assigned."),
FSMErrorCodes.INVESTIGATOR_NOT_STAFF: ("Investigator is not a staff user."), FSMErrorCodes.INVESTIGATOR_NOT_STAFF: ("Investigator is not a staff user."),
FSMErrorCodes.INVESTIGATOR_NOT_SUBMITTER: ( FSMErrorCodes.INVESTIGATOR_NOT_SUBMITTER: ("Only the assigned investigator can make this change."),
"Only the assigned investigator can make this change."
),
} }
def __init__(self, *args, code=None, **kwargs): def __init__(self, *args, code=None, **kwargs):