mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-12 12:39:43 +02:00
Patch agency fix
This commit is contained in:
parent
2a93750551
commit
29b9b0bf23
1 changed files with 5 additions and 2 deletions
|
@ -16,6 +16,7 @@ from registrar.models import (
|
||||||
UserDomainRole,
|
UserDomainRole,
|
||||||
VerifiedByStaff,
|
VerifiedByStaff,
|
||||||
PublicContact,
|
PublicContact,
|
||||||
|
FederalAgency,
|
||||||
)
|
)
|
||||||
|
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
|
@ -534,8 +535,9 @@ class TestPatchAgencyInfo(TestCase):
|
||||||
self.user, _ = User.objects.get_or_create(username="testuser")
|
self.user, _ = User.objects.get_or_create(username="testuser")
|
||||||
self.domain, _ = Domain.objects.get_or_create(name="testdomain.gov")
|
self.domain, _ = Domain.objects.get_or_create(name="testdomain.gov")
|
||||||
self.domain_info, _ = DomainInformation.objects.get_or_create(domain=self.domain, creator=self.user)
|
self.domain_info, _ = DomainInformation.objects.get_or_create(domain=self.domain, creator=self.user)
|
||||||
|
self.federal_agency, _ = FederalAgency.objects.get_or_create(agency="test agency")
|
||||||
self.transition_domain, _ = TransitionDomain.objects.get_or_create(
|
self.transition_domain, _ = TransitionDomain.objects.get_or_create(
|
||||||
domain_name="testdomain.gov", federal_agency="test agency"
|
domain_name="testdomain.gov", federal_agency=self.federal_agency
|
||||||
)
|
)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
@ -564,7 +566,8 @@ class TestPatchAgencyInfo(TestCase):
|
||||||
# Reload the domain_info object from the database
|
# Reload the domain_info object from the database
|
||||||
self.domain_info.refresh_from_db()
|
self.domain_info.refresh_from_db()
|
||||||
# Check that the federal_agency field was updated
|
# Check that the federal_agency field was updated
|
||||||
self.assertEqual(self.domain_info.federal_agency, "test agency")
|
federal_agency, _ = FederalAgency.objects.get_or_create(agency="test agency")
|
||||||
|
self.assertEqual(self.domain_info.federal_agency.agency, "test agency")
|
||||||
|
|
||||||
def test_patch_agency_info_skip(self):
|
def test_patch_agency_info_skip(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue