Fix unit tests

This commit is contained in:
zandercymatics 2024-01-02 13:46:26 -07:00
parent fd847a2a40
commit 20f34d56be
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 12 additions and 2 deletions

View file

@ -110,7 +110,13 @@ class Command(BaseCommand):
reader = csv.DictReader(requested_file, delimiter=seperator)
# Return a dictionary with the domain name as the key,
# and the row information as the value
dict_data = {row.get("Domain Name").lower(): row for row in reader}
dict_data = {}
for row in reader:
domain_name = row.get("Domain Name")
if domain_name is not None:
domain_name = domain_name.lower()
row[domain_name] = row
return dict_data
def patch_agency_info(self, debug):

View file

@ -39,7 +39,11 @@ class TestPatchAgencyInfo(TestCase):
@patch("registrar.management.commands.utility.terminal_helper.TerminalHelper.query_yes_no_exit", return_value=True)
def call_patch_federal_agency_info(self, mock_prompt):
"""Calls the patch_federal_agency_info command and mimics a keypress"""
call_command("patch_federal_agency_info", debug=True)
call_command(
"patch_federal_agency_info",
"registrar/tests/data/fake_current_full.csv",
debug=True
)
def test_patch_agency_info(self):
"""