mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-13 14:35:14 +02:00
Allow unknown state in data migration
This commit is contained in:
parent
01b1e3e520
commit
45f8e26018
5 changed files with 14 additions and 14 deletions
|
@ -176,6 +176,7 @@ class Command(BaseCommand):
|
|||
"clienthold": TransitionDomain.StatusChoices.ON_HOLD,
|
||||
"created": TransitionDomain.StatusChoices.READY,
|
||||
"ok": TransitionDomain.StatusChoices.READY,
|
||||
"unknown": TransitionDomain.StatusChoices.UNKNOWN,
|
||||
}
|
||||
mapped_status = status_maps.get(status_to_map)
|
||||
return mapped_status
|
||||
|
|
|
@ -1338,19 +1338,6 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
logger.info("Changing to DNS_NEEDED state")
|
||||
logger.info("able to transition to DNS_NEEDED state")
|
||||
|
||||
@transition(
|
||||
field="state",
|
||||
source="*",
|
||||
target=State.UNKNOWN,
|
||||
)
|
||||
def force_unknown(self):
|
||||
"""Force a domain to go into our unknown state.
|
||||
|
||||
This can be useful on a limited basis when we need a domain
|
||||
to be created in the registry for some reason.
|
||||
"""
|
||||
pass
|
||||
|
||||
def _disclose_fields(self, contact: PublicContact):
|
||||
"""creates a disclose object that can be added to a contact Create using
|
||||
.disclose= <this function> on the command before sending.
|
||||
|
|
|
@ -5,6 +5,7 @@ from .utility.time_stamped_model import TimeStampedModel
|
|||
class StatusChoices(models.TextChoices):
|
||||
READY = "ready", "Ready"
|
||||
ON_HOLD = "on hold", "On Hold"
|
||||
UNKNOWN = "unknown", "Unknown"
|
||||
|
||||
|
||||
class TransitionDomain(TimeStampedModel):
|
||||
|
|
|
@ -2,4 +2,4 @@ Anomaly.gov|muahaha|
|
|||
TestDomain.gov|ok|
|
||||
FakeWebsite1.gov|serverHold|
|
||||
FakeWebsite2.gov|Hold|
|
||||
FakeWebsite3.gov|ok|
|
||||
FakeWebsite3.gov|unknown|
|
||||
|
|
|
@ -193,6 +193,17 @@ class TestOrganizationMigration(TestCase):
|
|||
|
||||
self.assertEqual(transition, expected_transition_domain)
|
||||
|
||||
def test_transition_domain_status_unknown(self):
|
||||
"""
|
||||
Test that a domain in unknown status can be loaded
|
||||
""" # noqa - E501 (harder to read)
|
||||
# == First, parse all existing data == #
|
||||
self.run_load_domains()
|
||||
self.run_transfer_domains()
|
||||
|
||||
domain_object = Domain.objects.get(name="fakewebsite3.gov")
|
||||
self.assertEqual(domain_object.state, Domain.State.UNKNOWN)
|
||||
|
||||
def test_load_organization_data_domain_information(self):
|
||||
"""
|
||||
This test verifies the functionality of the load_organization_data method.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue