mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-11 20:19:38 +02:00
Merge pull request #1426 from cisagov/nmb/1425-force-unknown
Allow unknown state in data migration
This commit is contained in:
commit
1aceeaf624
5 changed files with 38 additions and 1 deletions
|
@ -176,6 +176,7 @@ class Command(BaseCommand):
|
||||||
"clienthold": TransitionDomain.StatusChoices.ON_HOLD,
|
"clienthold": TransitionDomain.StatusChoices.ON_HOLD,
|
||||||
"created": TransitionDomain.StatusChoices.READY,
|
"created": TransitionDomain.StatusChoices.READY,
|
||||||
"ok": TransitionDomain.StatusChoices.READY,
|
"ok": TransitionDomain.StatusChoices.READY,
|
||||||
|
"unknown": TransitionDomain.StatusChoices.UNKNOWN,
|
||||||
}
|
}
|
||||||
mapped_status = status_maps.get(status_to_map)
|
mapped_status = status_maps.get(status_to_map)
|
||||||
return mapped_status
|
return mapped_status
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Generated by Django 4.2.7 on 2023-12-01 17:45
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("registrar", "0047_transitiondomain_address_line_transitiondomain_city_and_more"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="transitiondomain",
|
||||||
|
name="status",
|
||||||
|
field=models.CharField(
|
||||||
|
blank=True,
|
||||||
|
choices=[("ready", "Ready"), ("on hold", "On Hold"), ("unknown", "Unknown")],
|
||||||
|
default="ready",
|
||||||
|
help_text="domain status during the transfer",
|
||||||
|
max_length=255,
|
||||||
|
verbose_name="Status",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -5,6 +5,7 @@ from .utility.time_stamped_model import TimeStampedModel
|
||||||
class StatusChoices(models.TextChoices):
|
class StatusChoices(models.TextChoices):
|
||||||
READY = "ready", "Ready"
|
READY = "ready", "Ready"
|
||||||
ON_HOLD = "on hold", "On Hold"
|
ON_HOLD = "on hold", "On Hold"
|
||||||
|
UNKNOWN = "unknown", "Unknown"
|
||||||
|
|
||||||
|
|
||||||
class TransitionDomain(TimeStampedModel):
|
class TransitionDomain(TimeStampedModel):
|
||||||
|
|
|
@ -2,4 +2,4 @@ Anomaly.gov|muahaha|
|
||||||
TestDomain.gov|ok|
|
TestDomain.gov|ok|
|
||||||
FakeWebsite1.gov|serverHold|
|
FakeWebsite1.gov|serverHold|
|
||||||
FakeWebsite2.gov|Hold|
|
FakeWebsite2.gov|Hold|
|
||||||
FakeWebsite3.gov|ok|
|
FakeWebsite3.gov|unknown|
|
||||||
|
|
|
@ -193,6 +193,17 @@ class TestOrganizationMigration(TestCase):
|
||||||
|
|
||||||
self.assertEqual(transition, expected_transition_domain)
|
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):
|
def test_load_organization_data_domain_information(self):
|
||||||
"""
|
"""
|
||||||
This test verifies the functionality of the load_organization_data method.
|
This test verifies the functionality of the load_organization_data method.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue