fixed other tests and linted

This commit is contained in:
David Kennedy 2025-01-16 19:31:11 -05:00
parent 2ad8e0268a
commit 75665ff378
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
3 changed files with 15 additions and 4 deletions

View file

@ -579,7 +579,10 @@ class MockDb(TestCase):
)
cls.suborganization_1, _ = Suborganization.objects.get_or_create(
name="SubOrg 1", portfolio=cls.portfolio_1, city="Nashville", state_territory="TN",
name="SubOrg 1",
portfolio=cls.portfolio_1,
city="Nashville",
state_territory="TN",
)
current_date = get_time_aware_date(datetime(2024, 4, 2))

View file

@ -2101,6 +2101,10 @@ class TestPatchSuborganizations(MockDbForIndividualTests):
1. Fewest spaces
2. Most leading capitals
"""
# Delete any other suborganizations defined in the initial test dataset
DomainRequest.objects.all().delete()
Suborganization.objects.all().delete()
Suborganization.objects.create(name="Test Organization ", portfolio=self.portfolio_1)
Suborganization.objects.create(name="test organization", portfolio=self.portfolio_1)
Suborganization.objects.create(name="Test Organization", portfolio=self.portfolio_1)
@ -2114,6 +2118,10 @@ class TestPatchSuborganizations(MockDbForIndividualTests):
@less_console_noise_decorator
def test_hardcoded_record(self):
"""Tests that our hardcoded records update as we expect them to"""
# Delete any other suborganizations defined in the initial test dataset
DomainRequest.objects.all().delete()
Suborganization.objects.all().delete()
# Create orgs with old and new name formats
old_name = "USDA/OC"
new_name = "USDA, Office of Communications"
@ -2123,7 +2131,7 @@ class TestPatchSuborganizations(MockDbForIndividualTests):
self.run_patch_suborganizations()
# Verify only the new one remains
# Verify only the new one of the two remains
self.assertEqual(Suborganization.objects.count(), 1)
remaining = Suborganization.objects.first()
self.assertEqual(remaining.name, new_name)

View file

@ -792,8 +792,8 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
"Chief Tester,Purpose of the site,CISA-first-name CISA-last-name | There is more,"
"Testy Tester testy2@town.com,"
"cisaRep@igorville.gov,city.com,\n"
"city6.gov,Submitted,Federal,Yes,Executive,Portfolio 1 Federal Agency,,N/A,,,2,,,,,,,,0,1,city1.gov,,,,,"
"Purpose of the site,CISA-first-name CISA-last-name | There is more,Testy Tester testy2@town.com,"
"city6.gov,Submitted,Federal,Yes,Executive,Portfolio 1 Federal Agency,,N/A,,,2,,,,,,,,0,1,city1.gov,"
",,,,Purpose of the site,CISA-first-name CISA-last-name | There is more,Testy Tester testy2@town.com,"
"cisaRep@igorville.gov,city.com,\n"
)