mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 17:17:02 +02:00
Merge conflictts pt 1
This commit is contained in:
parent
ca1a79a97f
commit
a5a3c13653
4 changed files with 58 additions and 58 deletions
|
@ -139,17 +139,17 @@ class DomainRequestAdminForm(forms.ModelForm):
|
||||||
|
|
||||||
# We only care about investigator when in these statuses
|
# We only care about investigator when in these statuses
|
||||||
checked_statuses = [
|
checked_statuses = [
|
||||||
DomainApplication.ApplicationStatus.APPROVED,
|
DomainRequest.DomainRequestStatus.APPROVED,
|
||||||
DomainApplication.ApplicationStatus.IN_REVIEW,
|
DomainRequest.DomainRequestStatus.IN_REVIEW,
|
||||||
DomainApplication.ApplicationStatus.ACTION_NEEDED,
|
DomainRequest.DomainRequestStatus.ACTION_NEEDED,
|
||||||
DomainApplication.ApplicationStatus.REJECTED,
|
DomainRequest.DomainRequestStatus.REJECTED,
|
||||||
DomainApplication.ApplicationStatus.INELIGIBLE,
|
DomainRequest.DomainRequestStatus.INELIGIBLE,
|
||||||
]
|
]
|
||||||
|
|
||||||
# If a status change occured, check for validity
|
# If a status change occured, check for validity
|
||||||
if status != initial_status and status in checked_statuses:
|
if status != initial_status and status in checked_statuses:
|
||||||
# Checks the "investigators" field for validity.
|
# Checks the "investigators" field for validity.
|
||||||
# That field must obey certain conditions when an application is approved.
|
# That field must obey certain conditions when an domain_request is approved.
|
||||||
# Will call "add_error" if any issues are found.
|
# Will call "add_error" if any issues are found.
|
||||||
self._check_for_valid_investigator(investigator)
|
self._check_for_valid_investigator(investigator)
|
||||||
|
|
||||||
|
@ -1163,7 +1163,7 @@ class DomainRequestAdmin(ListHeaderAdmin):
|
||||||
|
|
||||||
# == Handle non-status changes == #
|
# == Handle non-status changes == #
|
||||||
|
|
||||||
# Get the original application from the database.
|
# Get the original domain_request from the database.
|
||||||
original_obj = models.DomainRequest.objects.get(pk=obj.pk)
|
original_obj = models.DomainRequest.objects.get(pk=obj.pk)
|
||||||
if obj.status == original_obj.status:
|
if obj.status == original_obj.status:
|
||||||
# If the status hasn't changed, let the base function take care of it
|
# If the status hasn't changed, let the base function take care of it
|
||||||
|
@ -1203,9 +1203,9 @@ class DomainRequestAdmin(ListHeaderAdmin):
|
||||||
should_proceed = False
|
should_proceed = False
|
||||||
return should_proceed
|
return should_proceed
|
||||||
|
|
||||||
application_is_not_approved = obj.status != models.DomainRequest.DomainRequestStatus.APPROVED
|
request_is_not_approved = obj.status != models.DomainRequest.DomainRequestStatus.APPROVED
|
||||||
if application_is_not_approved and not obj.domain_is_not_active():
|
if request_is_not_approved and not obj.domain_is_not_active():
|
||||||
# If an admin tried to set an approved application to
|
# If an admin tried to set an approved domain_request to
|
||||||
# another status and the related domain is already
|
# another status and the related domain is already
|
||||||
# active, shortcut the action and throw a friendly
|
# active, shortcut the action and throw a friendly
|
||||||
# error message. This action would still not go through
|
# error message. This action would still not go through
|
||||||
|
@ -1248,7 +1248,7 @@ class DomainRequestAdmin(ListHeaderAdmin):
|
||||||
return (obj, should_proceed)
|
return (obj, should_proceed)
|
||||||
|
|
||||||
def get_status_method_mapping(self, domain_request):
|
def get_status_method_mapping(self, domain_request):
|
||||||
"""Returns what method should be ran given an application object"""
|
"""Returns what method should be ran given an DomainRequest object"""
|
||||||
# Define a per-object mapping
|
# Define a per-object mapping
|
||||||
status_method_mapping = {
|
status_method_mapping = {
|
||||||
models.DomainRequest.DomainRequestStatus.STARTED: None,
|
models.DomainRequest.DomainRequestStatus.STARTED: None,
|
||||||
|
|
|
@ -9,7 +9,7 @@ from django.db import models
|
||||||
from django_fsm import FSMField, transition # type: ignore
|
from django_fsm import FSMField, transition # type: ignore
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from registrar.models.domain import Domain
|
from registrar.models.domain import Domain
|
||||||
from registrar.utility.errors import FSMdomain_requestError, FSMErrorCodes
|
from registrar.utility.errors import FSMApplicationError, FSMErrorCodes
|
||||||
|
|
||||||
from .utility.time_stamped_model import TimeStampedModel
|
from .utility.time_stamped_model import TimeStampedModel
|
||||||
from ..utility.email import send_templated_email, EmailSendingError
|
from ..utility.email import send_templated_email, EmailSendingError
|
||||||
|
@ -19,7 +19,7 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DomainRequest(TimeStampedModel):
|
class DomainRequest(TimeStampedModel):
|
||||||
"""A registrant's request for a new domain."""
|
"""A registrant's domain request for a new domain."""
|
||||||
|
|
||||||
# Constants for choice fields
|
# Constants for choice fields
|
||||||
class DomainRequestStatus(models.TextChoices):
|
class DomainRequestStatus(models.TextChoices):
|
||||||
|
@ -116,7 +116,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
class OrganizationChoicesVerbose(models.TextChoices):
|
class OrganizationChoicesVerbose(models.TextChoices):
|
||||||
"""
|
"""
|
||||||
Secondary organization choices
|
Secondary organization choices
|
||||||
For use in the domain_request form and on the templates
|
For use in the domain request form and on the templates
|
||||||
Keys need to match OrganizationChoices
|
Keys need to match OrganizationChoices
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
NAMING_REQUIREMENTS = "naming_not_met", "Naming requirements not met"
|
NAMING_REQUIREMENTS = "naming_not_met", "Naming requirements not met"
|
||||||
OTHER = "other", "Other/Unspecified"
|
OTHER = "other", "Other/Unspecified"
|
||||||
|
|
||||||
# #### Internal fields about the domain_request #####
|
# #### Internal fields about the domain request #####
|
||||||
status = FSMField(
|
status = FSMField(
|
||||||
choices=DomainRequestStatus.choices, # possible states as an array of constants
|
choices=DomainRequestStatus.choices, # possible states as an array of constants
|
||||||
default=DomainRequestStatus.STARTED, # sensible default
|
default=DomainRequestStatus.STARTED, # sensible default
|
||||||
|
@ -380,7 +380,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
blank=True,
|
blank=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
# This is the domain_request user who created this domain_request. The contact
|
# This is the domain request user who created this domain request. The contact
|
||||||
# information that they gave is in the `submitter` field
|
# information that they gave is in the `submitter` field
|
||||||
creator = models.ForeignKey(
|
creator = models.ForeignKey(
|
||||||
"registrar.User",
|
"registrar.User",
|
||||||
|
@ -500,7 +500,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
)
|
)
|
||||||
|
|
||||||
# "+" means no reverse relation to lookup domain_requests from Website
|
# "+" means no reverse relation to lookup domain requests from Website
|
||||||
current_websites = models.ManyToManyField(
|
current_websites = models.ManyToManyField(
|
||||||
"registrar.Website",
|
"registrar.Website",
|
||||||
blank=True,
|
blank=True,
|
||||||
|
@ -513,7 +513,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text="The approved domain",
|
help_text="The approved domain",
|
||||||
related_name="domain_domain_request",
|
related_name="domain_request",
|
||||||
on_delete=models.SET_NULL,
|
on_delete=models.SET_NULL,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -522,7 +522,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text="The requested domain",
|
help_text="The requested domain",
|
||||||
related_name="domain_domain_request",
|
related_name="domain_request",
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
)
|
)
|
||||||
alternative_domains = models.ManyToManyField(
|
alternative_domains = models.ManyToManyField(
|
||||||
|
@ -531,8 +531,8 @@ class DomainRequest(TimeStampedModel):
|
||||||
related_name="alternatives+",
|
related_name="alternatives+",
|
||||||
)
|
)
|
||||||
|
|
||||||
# This is the contact information provided by the applicant. The
|
# This is the contact information provided by the domain requestor. The
|
||||||
# domain_request user who created it is in the `creator` field.
|
# user who created the domain request is in the `creator` field.
|
||||||
submitter = models.ForeignKey(
|
submitter = models.ForeignKey(
|
||||||
"registrar.Contact",
|
"registrar.Contact",
|
||||||
null=True,
|
null=True,
|
||||||
|
@ -572,7 +572,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
help_text="Acknowledged .gov acceptable use policy",
|
help_text="Acknowledged .gov acceptable use policy",
|
||||||
)
|
)
|
||||||
|
|
||||||
# submission date records when domain_request is submitted
|
# submission date records when domain request is submitted
|
||||||
submission_date = models.DateField(
|
submission_date = models.DateField(
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
|
@ -591,7 +591,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
if self.requested_domain and self.requested_domain.name:
|
if self.requested_domain and self.requested_domain.name:
|
||||||
return self.requested_domain.name
|
return self.requested_domain.name
|
||||||
else:
|
else:
|
||||||
return f"{self.status} domain_request created by {self.creator}"
|
return f"{self.status} domain request created by {self.creator}"
|
||||||
except Exception:
|
except Exception:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
@ -665,7 +665,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
target=DomainRequestStatus.SUBMITTED,
|
target=DomainRequestStatus.SUBMITTED,
|
||||||
)
|
)
|
||||||
def submit(self):
|
def submit(self):
|
||||||
"""Submit an domain_request that is started.
|
"""Submit an domain request that is started.
|
||||||
|
|
||||||
As a side effect, an email notification is sent."""
|
As a side effect, an email notification is sent."""
|
||||||
|
|
||||||
|
@ -713,7 +713,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
conditions=[domain_is_not_active, investigator_exists_and_is_staff],
|
conditions=[domain_is_not_active, investigator_exists_and_is_staff],
|
||||||
)
|
)
|
||||||
def in_review(self):
|
def in_review(self):
|
||||||
"""Investigate an domain_request that has been submitted.
|
"""Investigate an domain request that has been submitted.
|
||||||
|
|
||||||
This action is logged.
|
This action is logged.
|
||||||
|
|
||||||
|
@ -745,7 +745,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
conditions=[domain_is_not_active, investigator_exists_and_is_staff],
|
conditions=[domain_is_not_active, investigator_exists_and_is_staff],
|
||||||
)
|
)
|
||||||
def action_needed(self):
|
def action_needed(self):
|
||||||
"""Send back an domain_request that is under investigation or rejected.
|
"""Send back an domain request that is under investigation or rejected.
|
||||||
|
|
||||||
This action is logged.
|
This action is logged.
|
||||||
|
|
||||||
|
@ -783,7 +783,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
|
|
||||||
This has substantial side-effects because it creates another database
|
This has substantial side-effects because it creates another database
|
||||||
object for the approved Domain and makes the user who created the
|
object for the approved Domain and makes the user who created the
|
||||||
domain_request into an admin on that domain. It also triggers an email
|
domain request into an admin on that domain. It also triggers an email
|
||||||
notification."""
|
notification."""
|
||||||
|
|
||||||
# create the domain
|
# create the domain
|
||||||
|
@ -791,7 +791,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
|
|
||||||
# == Check that the domain_request is valid == #
|
# == Check that the domain_request is valid == #
|
||||||
if Domain.objects.filter(name=self.requested_domain.name).exists():
|
if Domain.objects.filter(name=self.requested_domain.name).exists():
|
||||||
raise FSMdomain_requestError(code=FSMErrorCodes.APPROVE_DOMAIN_IN_USE)
|
raise FSMApplicationError(code=FSMErrorCodes.APPROVE_DOMAIN_IN_USE)
|
||||||
|
|
||||||
# == Create the domain and related components == #
|
# == Create the domain and related components == #
|
||||||
created_domain = Domain.objects.create(name=self.requested_domain.name)
|
created_domain = Domain.objects.create(name=self.requested_domain.name)
|
||||||
|
@ -799,7 +799,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
|
|
||||||
# copy the information from DomainRequest into domaininformation
|
# copy the information from DomainRequest into domaininformation
|
||||||
DomainInformation = apps.get_model("registrar.DomainInformation")
|
DomainInformation = apps.get_model("registrar.DomainInformation")
|
||||||
DomainInformation.create_from_da(domain_domain_request=self, domain=created_domain)
|
DomainInformation.create_from_da(domain_request=self, domain=created_domain)
|
||||||
|
|
||||||
# create the permission for the user
|
# create the permission for the user
|
||||||
UserDomainRole = apps.get_model("registrar.UserDomainRole")
|
UserDomainRole = apps.get_model("registrar.UserDomainRole")
|
||||||
|
@ -812,7 +812,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
|
|
||||||
# == Send out an email == #
|
# == Send out an email == #
|
||||||
self._send_status_update_email(
|
self._send_status_update_email(
|
||||||
"domain_request approved",
|
"domain request approved",
|
||||||
"emails/status_change_approved.txt",
|
"emails/status_change_approved.txt",
|
||||||
"emails/status_change_approved_subject.txt",
|
"emails/status_change_approved_subject.txt",
|
||||||
send_email,
|
send_email,
|
||||||
|
@ -824,7 +824,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
target=DomainRequestStatus.WITHDRAWN,
|
target=DomainRequestStatus.WITHDRAWN,
|
||||||
)
|
)
|
||||||
def withdraw(self):
|
def withdraw(self):
|
||||||
"""Withdraw an domain_request that has been submitted."""
|
"""Withdraw an domain request that has been submitted."""
|
||||||
|
|
||||||
self._send_status_update_email(
|
self._send_status_update_email(
|
||||||
"withdraw",
|
"withdraw",
|
||||||
|
@ -839,7 +839,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
conditions=[domain_is_not_active, investigator_exists_and_is_staff],
|
conditions=[domain_is_not_active, investigator_exists_and_is_staff],
|
||||||
)
|
)
|
||||||
def reject(self):
|
def reject(self):
|
||||||
"""Reject an domain_request that has been submitted.
|
"""Reject an domain request that has been submitted.
|
||||||
|
|
||||||
As side effects this will delete the domain and domain_information
|
As side effects this will delete the domain and domain_information
|
||||||
(will cascade), and send an email notification."""
|
(will cascade), and send an email notification."""
|
||||||
|
@ -868,7 +868,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
"""The applicant is a bad actor, reject with prejudice.
|
"""The applicant is a bad actor, reject with prejudice.
|
||||||
|
|
||||||
No email As a side effect, but we block the applicant from editing
|
No email As a side effect, but we block the applicant from editing
|
||||||
any existing domains/domain_requests and from submitting new aplications.
|
any existing domains/domain requests and from submitting new aplications.
|
||||||
We do this by setting an ineligible status on the user, which the
|
We do this by setting an ineligible status on the user, which the
|
||||||
permissions classes test against. This will also delete the domain
|
permissions classes test against. This will also delete the domain
|
||||||
and domain_information (will cascade) when they exist."""
|
and domain_information (will cascade) when they exist."""
|
||||||
|
@ -881,7 +881,7 @@ class DomainRequest(TimeStampedModel):
|
||||||
# ## Form policies ###
|
# ## Form policies ###
|
||||||
#
|
#
|
||||||
# These methods control what questions need to be answered by applicants
|
# These methods control what questions need to be answered by applicants
|
||||||
# during the domain_request flow. They are policies about the domain_request so
|
# during the domain request flow. They are policies about the domain request so
|
||||||
# they appear here.
|
# they appear here.
|
||||||
|
|
||||||
def show_organization_federal(self) -> bool:
|
def show_organization_federal(self) -> bool:
|
||||||
|
@ -917,15 +917,15 @@ class DomainRequest(TimeStampedModel):
|
||||||
]
|
]
|
||||||
|
|
||||||
def has_rationale(self) -> bool:
|
def has_rationale(self) -> bool:
|
||||||
"""Does this domain_request have no_other_contacts_rationale?"""
|
"""Does this domain request have no_other_contacts_rationale?"""
|
||||||
return bool(self.no_other_contacts_rationale)
|
return bool(self.no_other_contacts_rationale)
|
||||||
|
|
||||||
def has_other_contacts(self) -> bool:
|
def has_other_contacts(self) -> bool:
|
||||||
"""Does this domain_request have other contacts listed?"""
|
"""Does this domain request have other contacts listed?"""
|
||||||
return self.other_contacts.exists()
|
return self.other_contacts.exists()
|
||||||
|
|
||||||
def is_federal(self) -> Union[bool, None]:
|
def is_federal(self) -> Union[bool, None]:
|
||||||
"""Is this domain_request for a federal agency?
|
"""Is this domain request for a federal agency?
|
||||||
|
|
||||||
organization_type can be both null and blank,
|
organization_type can be both null and blank,
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -599,11 +599,11 @@ def completed_domain_request(
|
||||||
|
|
||||||
return domain_request
|
return domain_request
|
||||||
|
|
||||||
def set_domain_request_investigators(application_list: list[DomainRequest], investigator_user: User):
|
def set_domain_request_investigators(domain_request_list: list[DomainRequest], investigator_user: User):
|
||||||
"""Helper method that sets the investigator field of all provided domain_requests"""
|
"""Helper method that sets the investigator field of all provided domain_requests"""
|
||||||
for application in application_list:
|
for request in domain_request_list:
|
||||||
application.investigator = investigator_user
|
request.investigator = investigator_user
|
||||||
application.save()
|
request.save()
|
||||||
|
|
||||||
|
|
||||||
def multiple_unalphabetical_domain_objects(
|
def multiple_unalphabetical_domain_objects(
|
||||||
|
|
|
@ -52,8 +52,8 @@ class TestDomainRequest(TestCase):
|
||||||
status=DomainRequest.DomainRequestStatus.INELIGIBLE, name="ineligible.gov"
|
status=DomainRequest.DomainRequestStatus.INELIGIBLE, name="ineligible.gov"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Store all application statuses in a variable for ease of use
|
# Store all domain request statuses in a variable for ease of use
|
||||||
self.all_applications = [
|
self.all_domain_requests = [
|
||||||
self.started_domain_request,
|
self.started_domain_request,
|
||||||
self.submitted_domain_request,
|
self.submitted_domain_request,
|
||||||
self.in_review_domain_request,
|
self.in_review_domain_request,
|
||||||
|
@ -269,7 +269,7 @@ class TestDomainRequest(TestCase):
|
||||||
]
|
]
|
||||||
|
|
||||||
# Set all investigators to none
|
# Set all investigators to none
|
||||||
set_domain_request_investigators(self.all_applications, None)
|
set_domain_request_investigators(self.all_domain_requests, None)
|
||||||
|
|
||||||
self.assert_fsm_transition_does_not_raise_error(test_cases, "submit")
|
self.assert_fsm_transition_does_not_raise_error(test_cases, "submit")
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ class TestDomainRequest(TestCase):
|
||||||
|
|
||||||
# Set all investigators to a user with no staff privs
|
# Set all investigators to a user with no staff privs
|
||||||
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
||||||
set_domain_request_investigators(self.all_applications, user)
|
set_domain_request_investigators(self.all_domain_requests, user)
|
||||||
|
|
||||||
self.assert_fsm_transition_does_not_raise_error(test_cases, "submit")
|
self.assert_fsm_transition_does_not_raise_error(test_cases, "submit")
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ class TestDomainRequest(TestCase):
|
||||||
]
|
]
|
||||||
|
|
||||||
# Set all investigators to none
|
# Set all investigators to none
|
||||||
set_domain_request_investigators(self.all_applications, None)
|
set_domain_request_investigators(self.all_domain_requests, None)
|
||||||
|
|
||||||
self.assert_fsm_transition_raises_error(test_cases, "in_review")
|
self.assert_fsm_transition_raises_error(test_cases, "in_review")
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ class TestDomainRequest(TestCase):
|
||||||
|
|
||||||
# Set all investigators to a user with no staff privs
|
# Set all investigators to a user with no staff privs
|
||||||
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
||||||
set_applications_investigators(self.all_applications, user)
|
set_applications_investigators(self.all_domain_requests, user)
|
||||||
|
|
||||||
self.assert_fsm_transition_raises_error(test_cases, "in_review")
|
self.assert_fsm_transition_raises_error(test_cases, "in_review")
|
||||||
|
|
||||||
|
@ -424,7 +424,7 @@ class TestDomainRequest(TestCase):
|
||||||
]
|
]
|
||||||
|
|
||||||
# Set all investigators to none
|
# Set all investigators to none
|
||||||
set_domain_request_investigators(self.all_applications, None)
|
set_domain_request_investigators(self.all_domain_requests, None)
|
||||||
|
|
||||||
self.assert_fsm_transition_raises_error(test_cases, "action_needed")
|
self.assert_fsm_transition_raises_error(test_cases, "action_needed")
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ class TestDomainRequest(TestCase):
|
||||||
|
|
||||||
# Set all investigators to a user with no staff privs
|
# Set all investigators to a user with no staff privs
|
||||||
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
||||||
set_applications_investigators(self.all_applications, user)
|
set_applications_investigators(self.all_domain_requests, user)
|
||||||
|
|
||||||
self.assert_fsm_transition_raises_error(test_cases, "action_needed")
|
self.assert_fsm_transition_raises_error(test_cases, "action_needed")
|
||||||
|
|
||||||
|
@ -484,7 +484,7 @@ class TestDomainRequest(TestCase):
|
||||||
]
|
]
|
||||||
|
|
||||||
# Set all investigators to none
|
# Set all investigators to none
|
||||||
set_domain_request_investigators(self.all_applications, None)
|
set_domain_request_investigators(self.all_domain_requests, None)
|
||||||
|
|
||||||
self.assert_fsm_transition_raises_error(test_cases, "approve")
|
self.assert_fsm_transition_raises_error(test_cases, "approve")
|
||||||
|
|
||||||
|
@ -501,7 +501,7 @@ class TestDomainRequest(TestCase):
|
||||||
|
|
||||||
# Set all investigators to a user with no staff privs
|
# Set all investigators to a user with no staff privs
|
||||||
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
||||||
set_applications_investigators(self.all_applications, user)
|
set_applications_investigators(self.all_domain_requests, user)
|
||||||
|
|
||||||
self.assert_fsm_transition_raises_error(test_cases, "approve")
|
self.assert_fsm_transition_raises_error(test_cases, "approve")
|
||||||
|
|
||||||
|
@ -555,7 +555,7 @@ class TestDomainRequest(TestCase):
|
||||||
]
|
]
|
||||||
|
|
||||||
# Set all investigators to none
|
# Set all investigators to none
|
||||||
set_domain_request_investigators(self.all_applications, None)
|
set_domain_request_investigators(self.all_domain_requests, None)
|
||||||
|
|
||||||
self.assert_fsm_transition_does_not_raise_error(test_cases, "withdraw")
|
self.assert_fsm_transition_does_not_raise_error(test_cases, "withdraw")
|
||||||
|
|
||||||
|
@ -573,7 +573,7 @@ class TestDomainRequest(TestCase):
|
||||||
|
|
||||||
# Set all investigators to a user with no staff privs
|
# Set all investigators to a user with no staff privs
|
||||||
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
||||||
set_applications_investigators(self.all_applications, user)
|
set_applications_investigators(self.all_domain_requests, user)
|
||||||
|
|
||||||
self.assert_fsm_transition_does_not_raise_error(test_cases, "withdraw")
|
self.assert_fsm_transition_does_not_raise_error(test_cases, "withdraw")
|
||||||
|
|
||||||
|
@ -615,7 +615,7 @@ class TestDomainRequest(TestCase):
|
||||||
]
|
]
|
||||||
|
|
||||||
# Set all investigators to none
|
# Set all investigators to none
|
||||||
set_domain_request_investigators(self.all_applications, None)
|
set_domain_request_investigators(self.all_domain_requests, None)
|
||||||
|
|
||||||
self.assert_fsm_transition_raises_error(test_cases, "reject")
|
self.assert_fsm_transition_raises_error(test_cases, "reject")
|
||||||
|
|
||||||
|
@ -632,7 +632,7 @@ class TestDomainRequest(TestCase):
|
||||||
|
|
||||||
# Set all investigators to a user with no staff privs
|
# Set all investigators to a user with no staff privs
|
||||||
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
||||||
set_applications_investigators(self.all_applications, user)
|
set_applications_investigators(self.all_domain_requests, user)
|
||||||
|
|
||||||
self.assert_fsm_transition_raises_error(test_cases, "reject")
|
self.assert_fsm_transition_raises_error(test_cases, "reject")
|
||||||
|
|
||||||
|
@ -676,7 +676,7 @@ class TestDomainRequest(TestCase):
|
||||||
]
|
]
|
||||||
|
|
||||||
# Set all investigators to none
|
# Set all investigators to none
|
||||||
set_domain_request_investigators(self.all_applications, None)
|
set_domain_request_investigators(self.all_domain_requests, None)
|
||||||
|
|
||||||
self.assert_fsm_transition_raises_error(test_cases, "reject_with_prejudice")
|
self.assert_fsm_transition_raises_error(test_cases, "reject_with_prejudice")
|
||||||
|
|
||||||
|
@ -694,7 +694,7 @@ class TestDomainRequest(TestCase):
|
||||||
|
|
||||||
# Set all investigators to a user with no staff privs
|
# Set all investigators to a user with no staff privs
|
||||||
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
user, _ = User.objects.get_or_create(username="pancakesyrup", is_staff=False)
|
||||||
set_applications_investigators(self.all_applications, user)
|
set_applications_investigators(self.all_domain_requests, user)
|
||||||
|
|
||||||
self.assert_fsm_transition_raises_error(test_cases, "reject_with_prejudice")
|
self.assert_fsm_transition_raises_error(test_cases, "reject_with_prejudice")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue