mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 17:47:02 +02:00
Change investigating to in review
This commit is contained in:
parent
82b5d43572
commit
5fa388ee2c
7 changed files with 50 additions and 22 deletions
|
@ -280,7 +280,7 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
||||||
# for the side effects (like an email send). Same
|
# for the side effects (like an email send). Same
|
||||||
# comment applies to original_obj method calls below.
|
# comment applies to original_obj method calls below.
|
||||||
original_obj.submit(updated_domain_application=obj)
|
original_obj.submit(updated_domain_application=obj)
|
||||||
elif obj.status == models.DomainApplication.INVESTIGATING:
|
elif obj.status == models.DomainApplication.IN_REVIEW:
|
||||||
original_obj.in_review(updated_domain_application=obj)
|
original_obj.in_review(updated_domain_application=obj)
|
||||||
elif obj.status == models.DomainApplication.APPROVED:
|
elif obj.status == models.DomainApplication.APPROVED:
|
||||||
original_obj.approve(updated_domain_application=obj)
|
original_obj.approve(updated_domain_application=obj)
|
||||||
|
|
|
@ -202,11 +202,11 @@ class DomainApplicationFixture:
|
||||||
"organization_name": "Example - Submitted but pending Investigation",
|
"organization_name": "Example - Submitted but pending Investigation",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"status": "investigating",
|
"status": "in review",
|
||||||
"organization_name": "Example - In Investigation",
|
"organization_name": "Example - In Investigation",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"status": "investigating",
|
"status": "in review",
|
||||||
"organization_name": "Example - Approved",
|
"organization_name": "Example - Approved",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -378,9 +378,9 @@ class DomainFixture(DomainApplicationFixture):
|
||||||
return
|
return
|
||||||
|
|
||||||
for user in users:
|
for user in users:
|
||||||
# approve one of each users investigating status domains
|
# approve one of each users in review status domains
|
||||||
application = DomainApplication.objects.filter(
|
application = DomainApplication.objects.filter(
|
||||||
creator=user, status=DomainApplication.INVESTIGATING
|
creator=user, status=DomainApplication.IN_REVIEW
|
||||||
).last()
|
).last()
|
||||||
logger.debug(f"Approving {application} for {user}")
|
logger.debug(f"Approving {application} for {user}")
|
||||||
application.approve()
|
application.approve()
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
# Generated by Django 4.2.2 on 2023-07-13 17:56
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
import django_fsm
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("registrar", "0027_alter_domaininformation_address_line1_and_more"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="domainapplication",
|
||||||
|
name="status",
|
||||||
|
field=django_fsm.FSMField(
|
||||||
|
choices=[
|
||||||
|
("started", "started"),
|
||||||
|
("submitted", "submitted"),
|
||||||
|
("in review", "in review"),
|
||||||
|
("approved", "approved"),
|
||||||
|
("withdrawn", "withdrawn"),
|
||||||
|
],
|
||||||
|
default="started",
|
||||||
|
max_length=50,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -21,13 +21,13 @@ class DomainApplication(TimeStampedModel):
|
||||||
# #### Contants for choice fields ####
|
# #### Contants for choice fields ####
|
||||||
STARTED = "started"
|
STARTED = "started"
|
||||||
SUBMITTED = "submitted"
|
SUBMITTED = "submitted"
|
||||||
INVESTIGATING = "investigating"
|
IN_REVIEW = "in review"
|
||||||
APPROVED = "approved"
|
APPROVED = "approved"
|
||||||
WITHDRAWN = "withdrawn"
|
WITHDRAWN = "withdrawn"
|
||||||
STATUS_CHOICES = [
|
STATUS_CHOICES = [
|
||||||
(STARTED, STARTED),
|
(STARTED, STARTED),
|
||||||
(SUBMITTED, SUBMITTED),
|
(SUBMITTED, SUBMITTED),
|
||||||
(INVESTIGATING, INVESTIGATING),
|
(IN_REVIEW, IN_REVIEW),
|
||||||
(APPROVED, APPROVED),
|
(APPROVED, APPROVED),
|
||||||
(WITHDRAWN, WITHDRAWN),
|
(WITHDRAWN, WITHDRAWN),
|
||||||
]
|
]
|
||||||
|
@ -538,7 +538,7 @@ class DomainApplication(TimeStampedModel):
|
||||||
"emails/submission_confirmation_subject.txt",
|
"emails/submission_confirmation_subject.txt",
|
||||||
)
|
)
|
||||||
|
|
||||||
@transition(field="status", source=SUBMITTED, target=INVESTIGATING)
|
@transition(field="status", source=SUBMITTED, target=IN_REVIEW)
|
||||||
def in_review(self, updated_domain_application):
|
def in_review(self, updated_domain_application):
|
||||||
"""Investigate an application that has been submitted.
|
"""Investigate an application that has been submitted.
|
||||||
|
|
||||||
|
@ -555,7 +555,7 @@ class DomainApplication(TimeStampedModel):
|
||||||
"emails/status_change_in_review_subject.txt",
|
"emails/status_change_in_review_subject.txt",
|
||||||
)
|
)
|
||||||
|
|
||||||
@transition(field="status", source=[SUBMITTED, INVESTIGATING], target=APPROVED)
|
@transition(field="status", source=[SUBMITTED, IN_REVIEW], target=APPROVED)
|
||||||
def approve(self, updated_domain_application=None):
|
def approve(self, updated_domain_application=None):
|
||||||
"""Approve an application that has been submitted.
|
"""Approve an application that has been submitted.
|
||||||
|
|
||||||
|
@ -601,7 +601,7 @@ class DomainApplication(TimeStampedModel):
|
||||||
"emails/status_change_approved_subject.txt",
|
"emails/status_change_approved_subject.txt",
|
||||||
)
|
)
|
||||||
|
|
||||||
@transition(field="status", source=[SUBMITTED, INVESTIGATING], target=WITHDRAWN)
|
@transition(field="status", source=[SUBMITTED, IN_REVIEW], target=WITHDRAWN)
|
||||||
def withdraw(self):
|
def withdraw(self):
|
||||||
"""Withdraw an application that has been submitted."""
|
"""Withdraw an application that has been submitted."""
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
Status:
|
Status:
|
||||||
</span>
|
</span>
|
||||||
{% if domainapplication.status == 'approved' %} Approved
|
{% if domainapplication.status == 'approved' %} Approved
|
||||||
{% elif domainapplication.status == 'investigating' %} In Review
|
{% elif domainapplication.status == 'in review' %} In Review
|
||||||
{% elif domainapplication.status == 'submitted' %} Received
|
{% elif domainapplication.status == 'submitted' %} Received
|
||||||
{% else %}ERROR Please contact technical support/dev
|
{% else %}ERROR Please contact technical support/dev
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -86,7 +86,7 @@ class TestDomainApplicationAdmin(TestCase):
|
||||||
model_admin = DomainApplicationAdmin(DomainApplication, self.site)
|
model_admin = DomainApplicationAdmin(DomainApplication, self.site)
|
||||||
|
|
||||||
# Modify the application's property
|
# Modify the application's property
|
||||||
application.status = DomainApplication.INVESTIGATING
|
application.status = DomainApplication.IN_REVIEW
|
||||||
|
|
||||||
# Use the model admin's save_model method
|
# Use the model admin's save_model method
|
||||||
model_admin.save_model(request, application, form=None, change=True)
|
model_admin.save_model(request, application, form=None, change=True)
|
||||||
|
@ -124,7 +124,7 @@ class TestDomainApplicationAdmin(TestCase):
|
||||||
|
|
||||||
with boto3_mocking.clients.handler_for("sesv2", mock_client):
|
with boto3_mocking.clients.handler_for("sesv2", mock_client):
|
||||||
# Create a sample application
|
# Create a sample application
|
||||||
application = completed_application(status=DomainApplication.INVESTIGATING)
|
application = completed_application(status=DomainApplication.IN_REVIEW)
|
||||||
|
|
||||||
# Create a mock request
|
# Create a mock request
|
||||||
request = self.factory.post(
|
request = self.factory.post(
|
||||||
|
|
|
@ -144,11 +144,11 @@ class TestDomainApplication(TestCase):
|
||||||
with self.assertRaises(TransitionNotAllowed):
|
with self.assertRaises(TransitionNotAllowed):
|
||||||
application.submit()
|
application.submit()
|
||||||
|
|
||||||
def test_transition_not_allowed_investigating_submitted(self):
|
def test_transition_not_allowed_in_review_submitted(self):
|
||||||
"""Create an application with status investigating and call submit
|
"""Create an application with status in review and call submit
|
||||||
against transition rules"""
|
against transition rules"""
|
||||||
|
|
||||||
application = completed_application(status=DomainApplication.INVESTIGATING)
|
application = completed_application(status=DomainApplication.IN_REVIEW)
|
||||||
|
|
||||||
with self.assertRaises(TransitionNotAllowed):
|
with self.assertRaises(TransitionNotAllowed):
|
||||||
application.submit()
|
application.submit()
|
||||||
|
@ -162,7 +162,7 @@ class TestDomainApplication(TestCase):
|
||||||
with self.assertRaises(TransitionNotAllowed):
|
with self.assertRaises(TransitionNotAllowed):
|
||||||
application.submit()
|
application.submit()
|
||||||
|
|
||||||
def test_transition_not_allowed_started_investigating(self):
|
def test_transition_not_allowed_started_in_review(self):
|
||||||
"""Create an application with status started and call in_review
|
"""Create an application with status started and call in_review
|
||||||
against transition rules"""
|
against transition rules"""
|
||||||
|
|
||||||
|
@ -171,16 +171,16 @@ class TestDomainApplication(TestCase):
|
||||||
with self.assertRaises(TransitionNotAllowed):
|
with self.assertRaises(TransitionNotAllowed):
|
||||||
application.in_review()
|
application.in_review()
|
||||||
|
|
||||||
def test_transition_not_allowed_investigating_investigating(self):
|
def test_transition_not_allowed_in_review_in_review(self):
|
||||||
"""Create an application with status investigating and call in_review
|
"""Create an application with status in review and call in_review
|
||||||
against transition rules"""
|
against transition rules"""
|
||||||
|
|
||||||
application = completed_application(status=DomainApplication.INVESTIGATING)
|
application = completed_application(status=DomainApplication.IN_REVIEW)
|
||||||
|
|
||||||
with self.assertRaises(TransitionNotAllowed):
|
with self.assertRaises(TransitionNotAllowed):
|
||||||
application.in_review()
|
application.in_review()
|
||||||
|
|
||||||
def test_transition_not_allowed_approved_investigating(self):
|
def test_transition_not_allowed_approved_in_review(self):
|
||||||
"""Create an application with status approved and call in_review
|
"""Create an application with status approved and call in_review
|
||||||
against transition rules"""
|
against transition rules"""
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ class TestDomainApplication(TestCase):
|
||||||
with self.assertRaises(TransitionNotAllowed):
|
with self.assertRaises(TransitionNotAllowed):
|
||||||
application.in_review()
|
application.in_review()
|
||||||
|
|
||||||
def test_transition_not_allowed_withdrawn_investigating(self):
|
def test_transition_not_allowed_withdrawn_in_review(self):
|
||||||
"""Create an application with status withdrawn and call in_review
|
"""Create an application with status withdrawn and call in_review
|
||||||
against transition rules"""
|
against transition rules"""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue